Recent Changes - Search:

WikiDoc

Categories

The [getStandardFolder] command

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).

FolderCode
ALM Locations Folderfall
ALM Modules Folderwalk
ALM Preferences Foldertrip
Appearance Folderappr
Apple Extras Folderaexƒ
Apple Menu Folderamnu
Apple Share Authentication Folderauth
Apple Share Support Foldershar
Application Support Folderasup
Applications Folderapps
Assistants Folderastƒ
Audio Alert Sounds Folderalrt
Audio Components Folderacmp
Audio Plug Ins Folderaplg
Audio Sound Banks Folderbank
Audio Sounds Folderasnd
Audio Support Folderadio
Boot Time Startup Items Folderempz'
Cached Data Foldercach
Carbon Library Foldercarb
Chewable Items Folderflnt
Classic Desktop Foldersdsk
Color Sync CMMFolderccmm
Color Sync Foldersync
Color Sync Profiles Folderprof
Color Sync Scripting Foldercscr
Components Foldercmpd
Contextual Menu Items Foldercmnu
Control Panel Disabled FolderctrD
Control Panel Folderctrl
Control Strip Modules Foldersdev
Core Services Foldercsrv
Desktop Folderdesk
Desktop Pictures Folderdtpƒ
Developer Docs Folderddoc
Developer Folderdevf
Developer Help Folderdevh
Directory Services Folderdsrv
Directory Services Plug Ins Folderdplg
Display Extensions Folderdspl
Documentation Folderinfo
Documents Folderdocs
Domain Library Folderdlib
Domain Top Level Folderdtop
Editors Folderoded
Extension Disabled FolderextD
Extension Folderextn
Favorites Folderfavs
File System Support Folderfsys
Find By Content Folderfbcf
Find By Content Indexes Folderfbcx
Find Support Folderfnds
Folder Actions Folderfasf
Fonts Folderfont
Frameworks Folderfram
Gen Editors Folderƒedi
Help Folderƒhlp
ISSDownloads Folderissd
Index Files Folderindx
Installer Logs Folderilgf
Installer Receipts Folderrcpt
Internet Folderintƒ
Internet Plug In Folderƒnet
Internet Search Sites Folderissf
Internet Sites Foldersite
Kernel Extensions Folderkext
Keyboard Layouts Folderklay
Keychain Folderkchn
Launcher Items Folderlaun
MIDI Drivers Foldermidi
Mac OS ReadMe Files Foldermorƒ
Managed Items Foldermang
Modem Scripts Folderƒmod
Movie Documents Foldermdoc
Multiprocessing Foldermpxf
Music Documents Folderdoc
Open Doc Editors Folderƒodf
Open Doc Folderodod
Open Doc Libraries Folderodlb
Open Doc Shell PlugIns Folderodsp
Picture Documents Folderpdoc
Preferences Folderpref
Print Monitor Docs Folderprnt
Printer Description Folderppdf
Printer Driver Folderƒprd
Printers Folderimpr
Printing PlugIns Folderpplg
Private Frameworks Folderpfrm
Public Folderpubb
Quick Time Components Folderwcmp
Quick Time Extensions Folderqtex
Recent Applications Folderrapp
Recent Documents Folderrdoc
Recent Servers Folderrsvr
Scripting Additions Folderƒscr
Scripts Folderscrƒ
Shared Libraries Folderƒlib
Shutdown Foldershdf
Shutdown Items Disabled FoldershdD
Sound Sets Foldersnds
Speakable Items Folderspki
Speech Folderspch
Startup Folderstrt
Startup Items Disabled FolderstrD
Stationery Folderodst
System Control Panel Foldersctl
System Desktop Foldersdsk
System Extension Disabled FoldermacD
System Foldermacs
System Preferences Foldersprf
System Sounds Folderssnd
System Trash Folderstrs
Temporary Foldertemp
Text Encodings Folderƒtex
Themes Folderthme
Trash Foldertrsh
User Specific Tmp Folderutmp
Utilities Folderutiƒ
Voices Folderfvoc
Volume Root Folderroot
Where To Empty Trash Folderempt

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

Page last modified on December 30, 2007, at 09:08 AM
Hosted on SourceForge.net Logo