newbie Q, help

Hello everyone
Can someone tell how do you figure out the creator and type of a file? I know the type is usually the “.jpg, . fp5 .ppt .esl etc” however I don’t know how to find the creator! Also things have changed in OS-X, how would I do the above in both OS 9 and OS X? so only 1 script is running on my LAN. Is possible for a user to be propted so they can add further file types depending on there needs, i.e. say a user wants to add “.dxf” would I have to edit the script, or can they do it through dialogue boxes which I would preprogram based on their additions? The whole point to this is to create a script to scan all the download folders, and after expanding the files to automatically sort them in to appropriate folders par their kind. i.e images ( all image files jpg,gif,pic,tiff etc), multimedia (QT,flash,realplayer) pdf’ to go into pdf file etc,etc. Well that’s it for now, thanks in advance
Sincerely Synergy

: Hello everyone

: Can someone tell how do you figure out the creator and type of a
: file? I know the type is usually the “.jpg, . fp5 .ppt
: .esl etc” however I don’t know how to find the creator!
: Also things have changed in OS-X, how would I do the above in
: both OS 9 and OS X? so only 1 script is running on my LAN. Is
: possible for a user to be propted so they can add further file
: types depending on there needs, i.e. say a user wants to add
: “.dxf” would I have to edit the script, or can they
: do it through dialogue boxes which I would preprogram based on
: their additions? The whole point to this is to create a script
: to scan all the download folders, and after expanding the
: files to automatically sort them in to appropriate folders par
: their kind. i.e images ( all image files jpg,gif,pic,tiff
: etc), multimedia (QT,flash,realplayer) pdf’ to go into pdf
: file etc,etc. Well that’s it for now, thanks in advance

The Finder will tell you file type and creator type.set theFile to (choose file)

tell application "Finder"
    set ft to file type of theFile
    set ct to creator type of theFile
end tell
activate
display dialog "File type: " & ft & return & "Creator: " & ct

This works in OS 9.x. I don’t know about OS X.x

To add new types/creators and direct them to the appropriate folder you would need to use the “choose from list” scripting addition command with a list of the available folders. The active type/creators could be kept in a list in a script property. When the script ran into a combination it hadn’t seen before it could query the user about which folder it should go to and then add the new type/creator to the list.
Marc K. Myers
Marc@AppleScriptsToGo.com
AppleScriptsToGo
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074

[02/14/2002 12:31:44 PM]