Changing creator/type in OS X
Changing creator/type in OS X
- Subject: Changing creator/type in OS X
- From: "Marc K. Myers" <email@hidden>
- Date: Sun, 9 Mar 2003 17:35:01 -0500
I wrote a script to change the creator and type of files in OS X. This
was the easiest thing in the world in OS 9 but I can't get it to work
in 10.2.4:
on run
--display dialog "This script functions only as a droplet" buttons
{"Cancel"} default button 1
open ((choose file) as list)
end run
on open (inItems)
repeat with anItem in inItems
if last character of (anItem as text) is not ":" then
modFile(anItem as alias)
end if
end repeat
end open
on modFile(theFile)
set theInfo to info for theFile
tell theInfo
set theName to name
set fType to file type
set fCreate to file creator
end tell
activate
set theRslt to (text returned of (display dialog theName & return &
return & ,
"File type: " default answer fType) & "????")
tell application "System Events"
set file type of file (theFile as text) to (text 1 thru 4 of
theRslt) as Unicode text
end tell
tell application "Finder" to update theFile
set theRslt to (text returned of (display dialog theName & return &
return & ,
"File creator: " default answer fCreate) & "????")
tell application "System Events"
set creator type of file (theFile as text) to (text 1 thru 4 of
theRslt) as Unicode text
end tell
tell application "Finder" to update theFile
end modFile
The script seems to work as I run it in Script Editor and follow it in
the event log. The only problem is that when it's done nothing has
been changed. Is there a trick to doing this in OS X?
Marc [03/09/03 5:34:23 PM]
_______________________________________________
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.