From somewhere around AS 1.8.3. or so, it is also possible to return the path as Unicode text.
It is also possible, though probably not necessary, to use AppleScript's raw syntax:
The result of this varies depending on the context. If used in a script application, it will return the full path to the application, including its name. If used in Apple's Script Editor, it will return the path to the editor. Other editors, such as Script Debugger, allow it to return the path to the calling script. Apple's Script Menu returns the path to the System Events app, which is the process that runs all Script Menu scripts.
The main use for this command is to find resources that are in a known location relative to a script application. I've used it in installers for example.
| Description |
Full form |
Code |
Result under OS 9.0.4 |
Result under OS 10.2 |
| the system folder |
path to system folder |
macs |
MacHD:System Folder: |
MacHD:System: |
| the desktop folder; objects in this folder show on the desk top. |
path to desktop |
desk |
MacHD:Desktop Folder: |
MacHD:Users:username:Desktop: |
| the desktop folder at the root of the hard drive, never the redirected user desktop folder |
|
sdsk |
MacHD:Desktop Folder: |
MacHD:Users:username:Desktop Folder: |
| the trash folder; objects in this folder show up in the trash |
path to trash folder |
trsh |
MacHD:Trash: |
MacHD:Users:username:.Trash: |
| the trash folder at the root of the drive, never the redirected user trash folder |
|
strs |
MacHD:Trash: |
Error (2) |
| the "empty trash" folder; Finder starts empty from here down |
|
empt |
MacHD:Trash: |
MacHD:Users:username:.Trash: |
| Print Monitor documents |
path to printmonitor |
prnt |
MacHD:System Folder:PrintMonitor Documents: |
Error (3) |
| Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here |
path to startup |
strt |
MacHD:System Folder:Startup Items: |
Error (2) |
| Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here |
path to shutdown |
shdf |
MacHD:System Folder:Shutdown Items: |
Error (2) |
| Finder objects to put into the Apple menu go here |
path to apple menu |
amnu |
MacHD:System Folder:Apple Menu Items: |
Error (2) |
| Control Panels go here (may contain INITs) |
path to control panels |
ctrl |
MacHD:System Folder:Control Panels: |
Error (2) |
| System control panels folder - never the redirected one, always "Control Panels" inside the System Folder |
|
sctl |
MacHD:System Folder:Control Panels: |
Error (2) |
| System extensions go here |
path to extensions folder |
extn |
MacHD:System Folder:Extensions: |
Error (2) |
| Fonts go here |
path to fonts folder |
font |
MacHD:System Folder:Fonts: |
MacHD:System:Library:Fonts: |
| preferences for applications go here |
path to preferences |
pref |
MacHD:System Folder:Preferences: |
MacHD:Users:username: Library:Preferences: |
| System-type Preferences go here - this is always the system's preferences folder, never a logged in user's |
path to system preferences |
sprf |
MacHD:System Folder:Preferences: |
MacHD:System:Library:PreferencePanes: |
| temporary files go here (deleted periodically, but don't rely on it.) |
path to temporary items folder |
temp |
MacHD:Temporary Items: |
MacHD:private:tmp:501:Temporary Items: |
| |
|
extD |
MacHD:System Folder:Extensions (disabled): |
Error (2) |
| |
|
ctrD |
MacHD:System Folder:Control Panels (disabled): |
Error (2) |
| |
|
macD |
MacHD:System Folder:System Extensions (Disabled): |
Error (2) |
| |
|
strD |
MacHD:System Folder:Startup Items (Disabled): |
Error (2) |
| |
|
shdD |
MacHD:System Folder:Shutdown Items (Disabled): |
Error (2) |
| |
path to At Ease applications folder |
apps |
MacHD:Applications: |
MacHD:Users:username:Applications: |
| |
path to At Ease documents folder |
docs |
MacHD:Documents: |
MacHD:Users:username:Documents: |
| root folder of a volume |
|
root |
MacHD:MacHD: |
MacHD:System: |
| items deleted at boot |
|
flnt |
MacHD:Cleanup At Startup: |
MacHD:private:tmp:501:Cleanup At Startup: |
| third-party items and folders |
path to application support folder |
asup |
MacHD:System Folder:Application Support: |
MacHD:Library:Application Support: |
| encoding tables |
|
ƒtex |
MacHD:System Folder:Text Encodings: |
Error (3) |
| stationery |
path to stationery folder |
odst |
MacHD:Stationery: |
Error (3) |
| OpenDoc root |
|
odod |
MacHD:System Folder:Editors:OpenDoc: |
Error (2) |
| OpenDoc Shell Plug-Ins in OpenDoc folder |
|
odsp |
MacHD:System Folder:Editors:OpenDoc:OpenDoc Shell Plug-Ins: |
Error (2) |
| OpenDoc editors in MacOS Folder |
path to editors folder |
oded |
MacHD:System Folder:Editors: |
Error (2) |
| OpenDoc subfolder of Editors folder |
|
ƒodf |
Error (1) |
Error (2) |
| OpenDoc libraries folder |
|
odlb |
MacHD:System Folder:Extensions:OpenDoc Libraries: |
Error (2) |
| CKH general editors folder at root level of Sys folder |
|
ƒedi |
Error (1) |
Error (2) |
| CKH help folder currently at root of system folder |
path to help folder |
ƒhlp |
MacHD:System Folder:Help: |
MacHD:Library:Documentation:Help: |
| CKH internet plug ins for browsers and stuff |
path to internet plugins folder |
ƒnet |
MacHD:System Folder:Internet Plug-Ins: |
Error (3) |
| CKH modem scripts, get 'em OUT of the Extensions folder |
path to modem scripts folder |
ƒmod |
MacHD:System Folder:Extensions:Modem Scripts: |
MacHD:System:Library:Modem Scripts: |
| CKH new folder at root of System folder for printer descs. |
path to printer descriptions folder |
ppdf |
MacHD:System Folder:Extensions:Printer Descriptions: |
MacHD:System:Library:Printers:PPDs: |
| CKH new folder at root of System folder for printer drivers |
path to printer drivers folder |
ƒprd |
MacHD:System Folder:Printer Drivers: |
Error (2) |
| CKH at root of system folder |
path to scripting additions folder |
ƒscr |
MacHD:System Folder:Scripting Additions: |
MacHD:System:Library:ScriptingAdditions: |
| CKH for general shared libs. |
path to shared libraries folder |
ƒlib |
MacHD:System Folder:Extensions: |
MacHD:System:Library:CFMSupport: |
| CKH macintalk can live here |
path to voices folder |
fvoc |
MacHD:System Folder:Extensions:Voices: |
MacHD:System:Library:Speech:Voices: |
| CKH for control strip modules |
path to control strip modules folder |
sdev |
MacHD:System Folder:Control Strip Modules: |
Error (2) |
| SJF for Assistants (MacOS Setup Assistant, etc) |
|
astƒ |
MacHD:Assistants: |
Error (3) |
| SJF for Utilities folder |
|
utiƒ |
MacHD:Utilities: |
MacHD:Applications:Utilities: |
| SJF for Apple Extras folder |
|
aexƒ |
MacHD:Apple Extras: |
MacHD:Applications:Extras: |
| SJF for Contextual Menu items |
|
cmnu |
MacHD:System Folder:Contextual Menu Items: |
MacHD:Library:Contextual Menu Items: |
| SJF for MacOS ReadMes folder |
|
morƒ |
MacHD:Mac OS Read Me Files: |
Error (2) |
| EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType) |
|
walk |
MacHD:System Folder:Extensions:Location Manager Modules: |
Error (2) |
| EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType) |
|
trip |
MacHD:System Folder:Preferences:Location Manager Prefs: |
Error (2) |
| EAS for Location Manager Locations (within kALMPreferencesFolderType) |
|
fall |
MacHD:System Folder:Preferences:Location Manager Prefs:Locations: |
Error (2) |
| for ColorSync™ Profiles |
|
prof |
MacHD:System Folder:ColorSync Profiles: |
MacHD:System:Library:ColorSync:Profiles: |
| for Theme data files |
|
thme |
MacHD:System Folder:Appearance:Theme Files: |
Error (3) |
| Favorties folder for Navigation Services |
|
favs |
MacHD:System Folder:Favorites: |
MacHD:Users:username:Library:Favorites: |
| Internet folder (root level of startup volume) |
|
intƒ |
MacHD:Internet: |
Error (2) |
| Appearance folder (root of system folder) |
|
appr |
MacHD:System Folder:Appearance: |
Error (3) |
| Sound Sets folder (in Appearance folder) |
|
snds |
MacHD:System Folder:Appearance:Sound Sets: |
Error (3) |
| Desktop Pictures folder (in Appearance folder) |
path to desktop pictures folder |
dtpƒ |
MacHD:System Folder:Appearance:Desktop Pictures: |
MacHD:Library:Desktop Pictures: |
| Internet Search Sites folder |
|
issf |
MacHD:System Folder:Internet Search Sites: |
MacHD:Users:username:Library:Internet Search Sites: |
| Find support folder |
|
fnds |
MacHD:System Folder:Extensions:Find: |
MacHD:System:Library:Find: |
| Find by content folder |
|
fbcf |
MacHD:TheFindByContentFolder: |
Error (3) |
| Installer Logs folder |
|
ilgf |
MacHD:Installer Logs: |
MacHD:Library:Receipts: |
| Scripts folder |
path to scripts folder |
scrƒ |
MacHD:System Folder:Scripts: |
MacHD:Users:username:Library:Scripts: |
| Folder Actions Scripts folder |
path to Folder Action scripts folder |
fasf |
MacHD:System Folder:Scripts:Folder Action Scripts: |
MacHD:Users:username:Library: Scripts:Folder Action Scripts: |
| Launcher Items folder |
path to launcher items folder |
laun |
MacHD:System Folder:Launcher Items: |
Error (2) |
| Recent Applications folder |
|
rapp |
MacHD:System Folder:Apple Menu Items:Recent Applications: |
MacHD:Users:username:Library:Recent Applications: |
| Recent Documents folder |
|
rdoc |
MacHD:System Folder:Apple Menu Items:Recent Documents: |
MacHD:Users:username:Library:Recent Documents: |
| Recent Servers folder |
|
rsvr |
MacHD:System Folder:Apple Menu Items:Recent Servers: |
MacHD:Users:username:Library:Recent Servers: |
| Speakable Items folder |
path to speakable items |
spki |
MacHD:System Folder:Apple Menu Items:Speakable Items: |
Error (3) |
| Keychain folder |
path to keychain folder |
kchn |
MacHD:System Folder:Preferences:Keychains: |
MacHD:Users:username:Library:Keychains: |
| QuickTime Extensions Folder (in Extensions folder) |
|
qtex |
MacHD:System Folder:Extensions:QuickTime Extensions: |
MacHD:System:Library:QuickTime: |
| Display Extensions Folder (in Extensions folder) |
|
dspl |
MacHD:System Folder:Extensions:Display Extensions: |
Error (2) |
| Multiprocessing Folder (in Extensions folder) |
|
mpxf |
MacHD:System Folder:Extensions:Multiprocessing: |
Error (2) |
| Printing Plug-Ins Folder (in Extensions folder) |
|
pplg |
MacHD:System Folder:Extensions:Printing Plug-ins: |
Error (2) |
| The top-level of a Folder domain, e.g. "/System" |
|
dtop |
Error (1) |
MacHD:System: |
| the Library subfolder of a particular domain |
|
dlib |
Error (1) |
MacHD:System:Library: |
| Contains ColorSync-related folders |
|
sync |
Error (1) |
MacHD:System:Library:ColorSync: |
| ColorSync CMMs |
|
ccmm |
Error (1) |
Error (3) |
| ColorSync Scripting support |
|
cscr |
Error (1) |
MacHD:System:Library:ColorSync:Scripting: |
| Contains Printing-related folders |
|
impr |
Error (1) |
MacHD:System:Library:Printers: |
| Contains Speech-related folders |
|
spch |
Error (1) |
MacHD:System:Library:Speech: |
| Contains Carbon-specific file |
|
carb |
Error (1) |
Error (3) |
| Contains Documentation files (not user documents) |
|
info |
Error (1) |
MacHD:Library:Documentation: |
| Contains Developer Documentation files and folders |
|
ddoc |
Error (1) |
MacHD:Developer:Documentation: |
| Contains Developer Help related files |
|
devh |
Error (1) |
MacHD:Developer:Documentation:Help: |
| Contains Developer Applications |
|
dapp |
Error (1) |
MacHD:Developer:Applications: |
| Logs folder |
|
logs |
Error (1) |
MacHD:Users:username:Library:Logs: |
| Contains Internet Search Sites downloaded from the Internet |
|
issd |
Error (1) |
MacHD:Users:username:Library:Internet Search Sites:.Downloads: |
| Contains temporary items created on behalf of the current user |
|
utmp |
Error (1) |
MacHD:private:tmp:501: |
| Contains various cache files for different clients |
|
cach |
Error (1) |
MacHD:Library:Caches: |
| Contains MacOS X Framework folders |
|
fram |
Error (1) |
MacHD:System:Library:Frameworks: |
| Contains MacOS X Private Framework folders |
|
pfrm |
Error (1) |
MacHD:System:Library:PrivateFrameworks: |
| MacOS 9 compatible desktop folder - same as kSystemDesktopFolderType but with a more appropriate name for Mac OS X code. |
|
sdsk |
MacHD:Desktop Folder: |
MacHD:Users:username:Desktop Folder: |
| Contains MacOS X Developer Resources |
|
devf |
Error (1) |
Error (3) |
| Contains Mac OS X System Sound Files |
|
ssnd |
Error (1) |
MacHD:System:Library:Sounds: |
| Contains Mac OS X components |
|
cmpd |
Error (1) |
MacHD:System:Library:Components: |
| Contains QuickTime components for Mac OS X |
|
wcmp |
Error (1) |
MacHD:System:Library:QuickTime: |
| Refers to the "CoreServices" folder on Mac OS X |
|
csrv |
Error (1) |
MacHD:System:Library:CoreServices: |
| Refers to the "Pictures" folder in a users home directory |
|
pdoc |
Error (1) |
MacHD:Users:username:Pictures: |
| Refers to the "Movies" folder in a users home directory |
|
mdoc |
Error (1) |
MacHD:Users:username:Movies: |
| Refers to the "Music" folder in a users home directory |
|
µdoc |
Error (1) |
MacHD:Users:username:Music: |
| Refers to the "Sites" folder in a users home directory |
|
site |
Error (1) |
MacHD:Users:username:Sites: |
| Refers to the "Public" folder in a users home directory |
|
pubb |
Error (1) |
MacHD:Users:username:Public: |
| Refers to the Audio support folder for Mac OS X |
|
adio |
Error (1) |
MacHD:Library:Audio: |
| Refers to the Sounds subfolder of Audio Support |
|
asnd |
Error (1) |
MacHD:Library:Audio:Sounds: |
| Refers to the Banks subfolder of the Sounds Folder |
|
bank |
Error (1) |
MacHD:Library:Audio:Sounds:Banks: |
| Refers to the Alert Sounds subfolder of the Sound Folder |
|
alrt |
Error (1) |
MacHD:Library:Audio:Sounds:Alerts: |
| Refers to the Plug-ins subfolder of the Audio Folder |
|
aplg |
Error (1) |
MacHD:Library:Audio:Plug-Ins: |
| Refers to the Components subfolder of the Audio Plug-ins Folder |
|
acmp |
Error (1) |
MacHD:Library:Audio:Plug-Ins:Components: |
| Refers to the Kernel Extensions Folder on Mac OS X |
|
kext |
Error (1) |
MacHD:System:Library:Extensions: |
| Refers to the Directory Services folder on Mac OS X |
|
dsrv |
Error (1) |
MacHD:Library:DirectoryServices: |
| Refers to the Directory Services Plug-Ins folder on Mac OS X |
|
dplg |
Error (1) |
MacHD:Library:DirectoryServices:PlugIns: |
| Refers to the "Receipts" folder in Mac OS X |
|
rcpt |
Error (1) |
MacHD:Library:Receipts: |
| Refers to the [domain]/Library/Filesystems folder in Mac OS X |
|
fsys |
Error (1) |
MacHD:System:Library:Filesystems: |
Refers to the [domain]/Library/Filesystems/ AppleShare folder in Mac OS X |
|
shar |
Error (1) |
MacHD:System:Library: Filesystems:AppleShare: |
Refers to the [domain]/Library/Filesystems/ AppleShare/Authentication folder in Mac OS X |
|
auth |
Error (1) |
MacHD:Library:Filesystems: AppleShare:Authentication: |
| Refers to the MIDI Drivers folder on Mac OS X |
|
midi |
Error (1) |
MacHD:Library:Audio:MIDI Drivers: |
| Refers to the [domain]/Library/KeyboardLayouts folder in Mac OS X |
|
klay |
Error (1) |
MacHD:System:Library:Keyboard Layouts: |
| PKE for Locales folder |
|
ƒloc |
MacHD:System Folder:Language & Region Support: |
Error (2) |
| Find By Content Plug-ins |
|
fbcp |
MacHD:System Folder:Extensions:Find:Find by Content Plug-ins: |
Error (2) |
| Users folder, contains one folder for each user. |
path to users folder |
usrs |
MacHD:Users: |
MacHD:Users: |
| The folder for the currently logged on user. |
path to current user folder |
cusr |
Error (1) |
MacHD:Users:username: |
| The remote folder for the currently logged on user |
|
rusf |
Error (1) |
Error (2) |
| The remote folder location for the currently logged on user |
|
rusr |
Error (1) |
Error (2) |
| A Shared "Documents" folder, readable & writeable by all users |
|
sdat |
MacHD:Users:Shared Documents: |
MacHD:Users:Shared: |
| Volume specific user information goes here |
|
vsfd |
MacHD:TheVolumeSettingsFolder: |
Error (2) |
| Appleshare puts volumes to automount inside this folder. |
|
srvƒ |
MacHD:System Folder:Servers: |
Error (2) |
| The "Applications" folder, pre Mac OS 9.1 |
|
åpps |
Error (1) |
Error (2) |
| The "Installer Logs" folder, pre Mac OS 9.1 |
|
îlgf |
Error (1) |
Error (2) |
| The "Assistants" folder, pre Mac OS 9.1 |
|
åstƒ |
Error (1) |
Error (2) |
| The "Utilities" folder, pre Mac OS 9.1 |
|
ütiƒ |
Error (1) |
Error (2) |
| The "Apple Extras" folder, pre Mac OS 9.1 |
|
åexƒ |
Error (1) |
Error (2) |
| The "Mac OS ReadMes" folder, pre Mac OS 9.1 |
|
µorƒ |
Error (1) |
Error (2) |
| The "Internet" folder, pre Mac OS 9.1 |
|
întƒ |
Error (1) |
Error (2) |
| The "Servers" folder, pre Mac OS 9.1 |
|
ßrvƒ |
Error (1) |
Error (2) |
| The "Stationery" folder, pre Mac OS 9.1 |
|
ødst |
Error (1) |
Error (2) |
| |
|
relf |
Error (1) |
Error (2) |
| |
|
spcf |
Error (1) |
Error (2) |
| |
|
blsf |
Error (1) |
Error (2) |
| |
|
rotf |
Error (1) |
MacHD:System: |