This page documents the new [getStandardFolder] command introduced in version 8.1d1 of AlphaX.
Description
The new command [getStandardFolder] has been introduced in order to wrap the
ToolBox function of the same name. It returns the full path of certain
system-related directories. Optionally this function can create (or
attempt to create, depending on the permissions) the folders when they do
not exist already.
Synopsis
The syntax of the command is the following:
getStandardFolder ?-create? folderType ?domain?
The arguments have the following signification:
- -create tells to attempt to create the folder if it does not exist. This argument is optional.
- folderType is a four-character code characterizing a particular folder (see below).
- domain is optional. It specifies the domain the folder belongs to. For instance, there are several Fonts directories on the system, corresponding to different domains: /System/Library/Fonts in the System domain, /Library/Fonts in the local domain, or ~/Fonts in the user domain. Possible values for this parameter are: classic, local, network, system, or user. If it is not specified, the default value is system.
Main folder codes
One must pass a four-character folder type for the folder you want to
find. The table below indicates the currently available codes. More
information can be found on Apple's Developer Connection at
http://developer.apple.com/documentation/Carbon/Reference/Folder_Manager/Reference/reference.html#//apple_ref/c/tdef/FolderType
These codes are declared in the Folders.h header found in the CoreServices
framework (see
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/Folders.h).
| Folder | Code |
| ALM Locations Folder | fall |
| ALM Modules Folder | walk |
| ALM Preferences Folder | trip |
| Appearance Folder | appr |
| Apple Extras Folder | aexƒ |
| Apple Menu Folder | amnu |
| Apple Share Authentication Folder | auth |
| Apple Share Support Folder | shar |
| Application Support Folder | asup |
| Applications Folder | apps |
| Assistants Folder | astƒ |
| Audio Alert Sounds Folder | alrt |
| Audio Components Folder | acmp |
| Audio Plug Ins Folder | aplg |
| Audio Sound Banks Folder | bank |
| Audio Sounds Folder | asnd |
| Audio Support Folder | adio |
| Boot Time Startup Items Folder | empz' |
| Cached Data Folder | cach |
| Carbon Library Folder | carb |
| Chewable Items Folder | flnt |
| Classic Desktop Folder | sdsk |
| Color Sync CMMFolder | ccmm |
| Color Sync Folder | sync |
| Color Sync Profiles Folder | prof |
| Color Sync Scripting Folder | cscr |
| Components Folder | cmpd |
| Contextual Menu Items Folder | cmnu |
| Control Panel Disabled Folder | ctrD |
| Control Panel Folder | ctrl |
| Control Strip Modules Folder | sdev |
| Core Services Folder | csrv |
| Desktop Folder | desk |
| Desktop Pictures Folder | dtpƒ |
| Developer Docs Folder | ddoc |
| Developer Folder | devf |
| Developer Help Folder | devh |
| Directory Services Folder | dsrv |
| Directory Services Plug Ins Folder | dplg |
| Display Extensions Folder | dspl |
| Documentation Folder | info |
| Documents Folder | docs |
| Domain Library Folder | dlib |
| Domain Top Level Folder | dtop |
| Editors Folder | oded |
| Extension Disabled Folder | extD |
| Extension Folder | extn |
| Favorites Folder | favs |
| File System Support Folder | fsys |
| Find By Content Folder | fbcf |
| Find By Content Indexes Folder | fbcx |
| Find Support Folder | fnds |
| Folder Actions Folder | fasf |
| Fonts Folder | font |
| Frameworks Folder | fram |
| Gen Editors Folder | ƒedi |
| Help Folder | ƒhlp |
| ISSDownloads Folder | issd |
| Index Files Folder | indx |
| Installer Logs Folder | ilgf |
| Installer Receipts Folder | rcpt |
| Internet Folder | intƒ |
| Internet Plug In Folder | ƒnet |
| Internet Search Sites Folder | issf |
| Internet Sites Folder | site |
| Kernel Extensions Folder | kext |
| Keyboard Layouts Folder | klay |
| Keychain Folder | kchn |
| Launcher Items Folder | laun |
| MIDI Drivers Folder | midi |
| Mac OS ReadMe Files Folder | morƒ |
| Managed Items Folder | mang |
| Modem Scripts Folder | ƒmod |
| Movie Documents Folder | mdoc |
| Multiprocessing Folder | mpxf |
| Music Documents Folder | doc |
| Open Doc Editors Folder | ƒodf |
| Open Doc Folder | odod |
| Open Doc Libraries Folder | odlb |
| Open Doc Shell PlugIns Folder | odsp |
| Picture Documents Folder | pdoc |
| Preferences Folder | pref |
| Print Monitor Docs Folder | prnt |
| Printer Description Folder | ppdf |
| Printer Driver Folder | ƒprd |
| Printers Folder | impr |
| Printing PlugIns Folder | pplg |
| Private Frameworks Folder | pfrm |
| Public Folder | pubb |
| Quick Time Components Folder | wcmp |
| Quick Time Extensions Folder | qtex |
| Recent Applications Folder | rapp |
| Recent Documents Folder | rdoc |
| Recent Servers Folder | rsvr |
| Scripting Additions Folder | ƒscr |
| Scripts Folder | scrƒ |
| Shared Libraries Folder | ƒlib |
| Shutdown Folder | shdf |
| Shutdown Items Disabled Folder | shdD |
| Sound Sets Folder | snds |
| Speakable Items Folder | spki |
| Speech Folder | spch |
| Startup Folder | strt |
| Startup Items Disabled Folder | strD |
| Stationery Folder | odst |
| System Control Panel Folder | sctl |
| System Desktop Folder | sdsk |
| System Extension Disabled Folder | macD |
| System Folder | macs |
| System Preferences Folder | sprf |
| System Sounds Folder | ssnd |
| System Trash Folder | strs |
| Temporary Folder | temp |
| Text Encodings Folder | ƒtex |
| Themes Folder | thme |
| Trash Folder | trsh |
| User Specific Tmp Folder | utmp |
| Utilities Folder | utiƒ |
| Voices Folder | fvoc |
| Volume Root Folder | root |
| Where To Empty Trash Folder | empt |
Note: some of the codes in the table above use the ƒ symbol. This is
the character of code 196 (0xc4 in hexadecimal) in the MacRoman encoding.
It corresponds to the U+0192 code-point in the Utf-8 Unicode encoding form.
It is obtained from the keyboard by typing opt-f.
Note: Above list contains only the more commonly used folders. A complete list of codes together with further technical details may be found at http://developer.apple.com/documentation/Carbon/Reference/Folder_Manager/Reference/reference.html#//apple_ref/c/tdef/FolderType.
Examples
Here are some examples to demonstrate the use of the [getStandardFolder] command:
Welcome to AlphaX's AlphaTcl shell.
«MacOS» version
AlphaX 8.1d1, Wednesday, 11 January 2006
«MacOS» info command getStandardFolder
getStandardFolder
«MacOS» getStandardFolder asup user
/Users/bernardo/Library/Application Support/
«MacOS» getStandardFolder asup local
/Library/Application Support/
«MacOS» getStandardFolder flnt user
Error:
«MacOS» getStandardFolder -create flnt user
/Users/bernardo/Library/Caches/Cleanup At Startup/
(add your comments here...)
Last updated 2006-04-23 10:07:01