Re: Help! My Applescript no longer works in Panther
Re: Help! My Applescript no longer works in Panther
- Subject: Re: Help! My Applescript no longer works in Panther
- From: Nigel Garvey <email@hidden>
- Date: Wed, 14 Jan 2004 01:28:35 +0000
Michael McLaughlin wrote on Tue, 13 Jan 2004 11:18:36 -0500:
>
Ever since upgrading from Jaguar to Panther, the following script
>
(drag-and-drop application) no longer works. It appears that TEXT
>
cannot be converted to file types or creator types. Is there some
>
missing cast not heretofore required?
>
>
TIA.
>
>
***** the script *****
>
>
on open (theList)
>
tell application "Finder"
>
set dialogResult to display dialog "New File Type: " buttons
>
"OK" default button 1 default answer "TEXT"
>
set fileType to text returned of dialogResult
>
set dialogResult to display dialog "New Creator Code: " buttons
>
"OK" default button 1 default answer "R*ch"
>
set creatorType to text returned of dialogResult
>
repeat with theItem in theList
>
if class of theItem is file then
>
set locked of theItem to false
>
end if
>
set file type of theItem to fileType
>
set creator type of theItem to creatorType
>
end repeat
>
end tell
>
end open
This doesn't work properly in Jaguar either. 'Class of theItem' always
returns 'alias'. Also, maybe you only want to set the file type and
creator type for document files, in which case those two lines should be
in the 'if' block too (assuming you can get them to work).
if class of item (theItem as string) is document file then
set locked of theItem to false
set file type of theItem to fileType
set creator type of theItem to creatorType
end if
NG
_______________________________________________
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.