Re: creator & type codes???
Re: creator & type codes???
- Subject: Re: creator & type codes???
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 14 Apr 2003 19:15:31 -0700
On 4/14/03 6:45 PM, "Doug McNutt" <email@hidden> wrote:
>
At 00:23 -0400 4/13/03, Arthur wrote:
>
> Ok I'm new at all this scripting, and I'd like to know on os X and os 9 how
>
> do you find out what the creator & file types are
>
>
On MacOS 9 and below by far the easiest access to creator, type, and other HFS
>
data is Apple's Resedit. A free download from Apple. Apple's MPW, also free,
>
provides a command line interface which will do the same thing but has a
>
learning curve that may no longer be worth it.
>
>
On MacOS neXt there are two tools in the developer tools package. SetFile
>
which allows you to change things and GetFileInfo which shows the current
>
values. Yes. Both of them require a terminal or other shell session.
Whoa! He just wants to find out what the creator type and file type are!
None of that is necessary. In both OS X and OS 9 there are two ways, outside
the Finder and within it:
set creaType to file creator of (info for alias "HD:Folder 1:Folder 2:File
Name")
set fileType to file type of (info for alias "HD:Folder 1:Folder 2: File
Name")
If you want both:
set someFile to alias "HD:Folder 1:Folder 2: File Name"
set {creaType, fileType} to {file creator, file type} of (info for
someFile)
If you're repeat this for many, many files it can take a while since 'info
for' also calculates the size. Read more about 'info for' in the Standard
Additions dictionary.
In the Finder:
tell application "Finder"
set {creaType, fileType} to {creator type, file type} of file
"HD:Folder 1:Folder 2: File Name"
end tell
Note that it's 'creator type' in the Finder, 'file creator' in 'info for'.
To _set_ a file type or creator type (be sure you know what you're doing)
you must use the Finder. (In OS 9 you can also use Akua Sweets scripting
addition.)
--
Paul Berkowitz
_______________________________________________
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.