4-character codes for MacOS special items [was: script in startup folder]
4-character codes for MacOS special items [was: script in startup folder]
- Subject: 4-character codes for MacOS special items [was: script in startup folder]
- From: Kai <email@hidden>
- Date: Mon, 21 Jul 2003 00:14:00 +0100
on Fri, 18 Jul 2003 13:34:34 +0200, Peter Sass <email@hidden> wrote:
>
16/07/03 Kai wrote:
>
>
> that would make my suggestions read as follows (each still one line):
[snip]
>
Thank you for those examples. I think too that a filepath is easier to read
>
than the 'of folder ... of folder' form. And terse is beatyful. Your examples
>
>
> tell application "Finder" to open file (((path to "ctrl") as string)
>
> & "Quickstart")
>
>
and
>
>
> tell application "Finder" to open file (((path to "root") as string)
>
> & "Teknik:Systemfolder:Controlpanels:Quickstart")
>
>
uses a method of writing pathnames that I can't find in my book (Benny
>
Goodman: The applescript handbook, second edition). Are there any other words
>
than "root" and "ctrl" that can be used in this way?
There are a number, Peter. Some of them are represented by constant terms,
with which you may be more familiar. For example, here are a few returned by
the system I'm using at the moment:
---- -------------
Code Constant Term
---- -------------
"amnu" = apple menu items folder
"apps" = At Ease applications folder
"asup" = application support
"boot" = startup disk
"ctrl" = control panels
"cusr" = current user folder
"desk" = desktop folder
"docs" = At Ease documents folder
"extn" = extensions folder
"fasf" = Folder Action scripts folder
"font" = fonts folder
"fvoc" = voices folder
"kchn" = keychain folder
"laun" = launcher items folder
"macs" = system folder
"oded" = editors folder
"odst" = stationery folder
"ppdf" = printer descriptions
"pref" = preferences folder
"prnt" = printmonitor folder
"sdev" = control strip modules folder
"sdsk" = startup disk
"shdf" = shutdown items folder
"sprf" = system preferences
"strt" = startup items folder
"temp" = temporary items folder
"trsh" = trash folder
"usrs" = users folder
---------------------
Because not every special item has a constant term assigned to it, knowledge
of these 4-character codes can be especially useful.
I've written a small applet to help identify many (130+) of the MacOS
special folders/items (including OS X-only & pre-OS 9.1 versions) by their
codes. It then attempts to reveal in the Finder any item selected from the
list. The 4-character code representing the selected item is also placed on
the clipboard. If an item doesn't exist, it may be created (although a
dialog then offers to delete it). When an invisible item can't be revealed,
its path is still quoted.
Unfortunately, since some of the 4-character codes won't get past the
server's ASCII mangle and, because I'm not too keen on bloating the script
with otherwise unnecessary code to side-step the problem, there's little
point in posting it here.
However, if anyone would like a copy forwarded directly to them, just send a
message (off-list) - with "Special MacOS Items" in the subject line - to:
email@hidden
--
Kai
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.