Here is a simple method that will return the absolute path of the Desktop folder as the function result.
` Project Method: Desktop_Folder
` Return: Path to the Desktop folder
C_TEXT($0;$path;$4Dfolder)
C_LONGINT($platform;$system;$vlSys;$i)
PLATFORM PROPERTIES($platform;$system)
If ($platform=3)
$path:=System folder(Desktop Win )
Else
$vlSys:=$system\256
If ($vlSys=16)
$path:=System folder(Preferences or Profiles_User )
$path:=Replace string($path;"Library:Preferences:";"Desktop:")
Else
$4Dfolder:=System folder(System )
For ($i;1;Length($4Dfolder))
If ($4Dfolder[[$i]]=":")
$path:=Substring($4Dfolder;1;$i)+"Desktop Folder:"
$i:=Length($4Dfolder)+1
End if
End for
End if
End if
$0:=$path