Re: Scripts for scripters
Re: Scripts for scripters
- Subject: Re: Scripts for scripters
- From: Gary Lists <email@hidden>
- Date: Thu, 22 May 2003 06:39:49 -0400
On or about 5/21/03 3:00 AM, Joseph Weaks wrote:
>
Rob,
>
Regarding backward compatibility, the script does break in earlier OSes,
>
including 10.1.5. However, just put a tell block around the single
>
"copy..." line and it'll ignore folders/codes that don't exist.
>
Cheers,
>
Joe Weaks
>
Texas
>
>
>
On Tuesday, May 20, 2003, at 03:50 PM, Rob Jorgensen wrote:
>
> ...Show Path Codes: This contains 83 of the 4-character codes which can
>
> be used with the "path to" command to generate aliases to common Mac OS
>
> folders. ...
>
> All scripts tested with OS X 10.2.6. I don't know when the path codes
>
> became available so I can't offer an accurate guess regarding backward
>
> compatibility. <shrug>
>
>
>
> --
>
> Rob Jorgensen
>
> Ohio, USA
Rob, Joseph, et. al.,
On this subject in general, and regarding Rob's script specifically, I liked
the idea of being able to put a chunk on the clipboard from this flavor of
'path to' testers, and so added that feature to my pre-existing script
(written during a similar discussion here in January, originally to do with
At Ease, as I recall...check the archives and 'has' pages for some .h
parsing discussion and a big long list of these codes.)
Here is a flavor, called "Path To Codes 9X", which contains the 137 path
codes available in that header file (I think all from that file), and it
will tell you which ones are valid for your OS. Just double-click, select
one of 4 task commands (make a report, show a list, output a file) and the
codes that are available to your current OS will be displayed. The count of
valid and invalid codes for your OS is also shown. Also displayed, by the
way, is the "C language name" of the special folder represented by the code.
The script will, alternatively, just write out a text file with the codes,
the current path and the actual C header file comment, if there was one in
the 'folders.h' header. The list represents, again, only the codes
available to the current OS.
Pretty nifty as a reference tool and by putting the "path to" code chunk on
the clipboard idea from Rob, its made a versatile little tool for OS9 and X.
(I don't use the 'path to' command enough to make getting that tiny chunk of
code with this tool all that efficient, but I find it a very useful
reference, especially a printed listing of the 88 or so that OS9-available.)
I updated some notes to make a Read Me, which also explains how to add more
code records, take codes out or edit the codes and comments (which were
supplied by Apple programmers, not me) of the folder descriptions. I use a
list-of-lists in the script, with each list having three items: the C
variable name, the 4-char Mac code, the description. AppleScript supplies
the local path from the code.
I do not have OSX, but the general script is very short and basically the
same kind of "path to" stuff, so I can't imagine why it wouldn't work for
all OS. If you are using this tool, however, then making any slight change
will be snap.
I've titled the script "Path To Codes 9X" for this public sharing, and
bundled a Read Me, the source code, a ready applet and the actual text data
of the codes (two forms, one as an AppleScript list of lists, the other as
line-by-line listing as grepped from the folders.h file.)
All of this is in one StuffIt archive [84k] and can be downloaded directly
from:
<
http://NicheCrafters.com/cgi-bin/getfile.pl?get&applescript/PathToCodes9X.s
it.hqx>
If you were to link to the file, please link to the downloads area in
general, please: <
http://NicheCrafters.com/NicheTech/> instead of to the
direct file.
(I'm providing a direct link here, because I haven't updated the HTML to
reflect the file's availability.)
Okay, that's all. Thanks for sharing, Rob.
--
Gary
_______________________________________________
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.