The [getStandardFolder] command.

Description

The getStandardFolder command returns the full path of certain directories linked to the system. Optionally, this function can create (or attempt to create, depending on the permissions) the folders when they do not already exist.

Synopsis

The syntax of the command is:
getStandardFolder ?-create? name ?domain?
The arguments have the following signification: Note that the directory returned by this command may not exist. This method simply gives the appropriate location for the requested directory. Furthermore, this command will not necessarily succeed and return a folder path, depending on the requested domain. If no folder path is found, the command raises an error.

Symbolic folder names

One must specify the folder using a symbolic name. The table below indicates the currently available names:
NameDescription
AdminApplicationsSystem and network administration applications (Utilities)
ApplicationsSupported applications
ApplicationScriptsThe user scripts folder for the calling application
ApplicationSupportApplication support files
AutosavedInformationThe user’s autosaved documents
CachesDiscardable cache files
CoreServicesCore services
DemoApplicationsUnsupported applications and demonstration versions
DesktopThe user’s desktop directory
DeveloperDeveloper resources
DeveloperApplicationsDeveloper applications
DocumentsDocuments directory
DocumentationDocumentation
DownloadsThe user’s downloads directory
InputMethodsInput Methods
LibraryVarious user-visible documentation, support, and configuration files
MoviesThe user’s Movies directory
MusicThe user’s Music directory
PicturesThe user’s Pictures directory
PreferencePanesThe PreferencePanes directory for use with System Preferences
PrinterDescriptionThe system’s PPDs directory
SharedPublicThe user’s Public sharing directory
TrashThe trash directory
UsersUser home directories (/Users)

Examples

Here are some examples to demonstrate the use of the [getStandardFolder] command. Open the Tcl Shell (with ⌘Y) and enter the following commands, one by one.
To get the user's Applications folder:
getStandardFolder AllApplications user
To get the local Applications folder:
getStandardFolder AllApplications local
To get the local Demos folder:
getStandardFolder DemoApplication local
To get the user's Demos folder and create it if does not exist:
getStandardFolder -create DemoApplication user
To get the system Users folder:
getStandardFolder User system


Last updated 2020-05-27 14:28:48