Can't set creator type
Can't set creator type
- Subject: Can't set creator type
- From: Mr Tea <email@hidden>
- Date: Tue, 24 Feb 2004 01:39:40 +0000
Why does this not work?
--============================================
set fList to selection of application "Finder"
repeat with f in fList
set f to f as alias
tell application "Finder"
set theCode to creator type of f
activate
display dialog "Creator" default answer theCode returning dRes
if the text returned of dRes is not "" then
set theCode to the text returned of dRes
set creator type of f to theCode
end if
end tell
end repeat
--============================================
The above is based on a snippet from a much longer script that worked in
Jaguar but fails in Panther. No matter what I do to try and coerce the
contents of 'theCode' into a form that works, the script fails on the line
'set creator type of f to theCode', returning a -1700 'can't make some data
into the expected type' error. If I simply do 'set theCode to "asDB"' (or
similar) before setting the creator type of the file, no problem, but when
the value of theCode is the text returned from a dialog, no dice
(AppleScript's own dialogs and the 24U Appearance variety both return this
error. I tried using System Events to set the file's creator type instead,
but that returned an 'NSDontUnderstandWhatThisMeans' error.
Can anyone tell me what's going wrong?
Nick
pp Mr Tea
--
_______________________________________________
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.