Re insert file type and creator

Sarah Reichelt sarah.reichelt at gmail.com
Tue Jul 29 00:40:32 EDT 2008


> For the applescript solution, my rev code is working but not my applescript
> (there is no "the" in the
> syntax, which i found on the web:)
>
> My script builds this script which should work (I always test in Applescript
> itself...)
>
> tell application "Finder"
> set creator type of "Macintosh HD:Users:sivakatirswami:Desktop:_temp:a tst
> creator:image.tiff" to "8BIM"
> set file type of "Macintosh HD:Users:sivakatirswami:Desktop:_temp:a tst
> creator:image.tiff" to "8BIM"
> end tell
>
> generates an error:
>
> Can't set «class fcrt» of "Macintosh HD:Users:sivakatirswami:Desktop:_temp:a
> tst creator:image.tiff" to "8BIM".
>
> And since I don't have a clue what "class fcrt" means... I'm stuck.

In my tests, using "the" or not made no difference, but file
references are a bit strange in AppleScript.
Try using:

set creator type of alias "Macintosh
HD:Users:sivakatirswami:Desktop:_temp:a tst creator:image.tiff" to
"8BIM"

and add the "alias" keyword to the file type line also.
If that doesn't work, use the word "file" where I have used "alias"
As far as I can tell, AppleScript has no way of knowing that the
string you provide is a file reference unless you tell it so.

Cheers,
Sarah



More information about the use-livecode mailing list