getspecialfolder
Retrieves the path of a special folder.
Format
getspecialfolder <strvar> <foldertype>
Remarks
Stores the path of the special folder given by <foldertype> to the <strvar> string variable. The type names are the same as on Windows, and the nearest Mac folder (see the table below) is returned for each. '~' stands for the home folder (e.g. /Users/user); the stored value is the expanded path.
Parameters
- string variable <strvar>
- Returns into the got string.
- string <foldertype>
- The drive and path of the specified folder by the string <foldertype> stores into the <strvar> string variable.
AllUsersDesktop /Users/Shared AllUsersStartMenu /Applications AllUsersPrograms /Applications AllUsersStartup /Library/LaunchAgents Desktop ~/Desktop Favorites the home folder Fonts /Library/Fonts MyDocuments ~/Documents NetHood the home folder PrintHood the home folder Programs ~/Applications Recent the home folder SendTo the home folder StartMenu ~/Applications Startup ~/Library/LaunchAgents Templates the home folder
Return Value
- System variable <result>
- When the command fails, 0 is stored.
When the command succeeds, 1 is stored.
Example
getspecialfolder str "Desktop" if result then messagebox str "Desktop" ; /Users/user/Desktop endif