On Oct 21, 2010, at 4:54 PM, Scott Babcock wrote:
I have a request for a feature that would solve a problematic AppleScript behavior - conversion of raw Apple Event codes to their "friendly" equivalents and rendering the affected code non-compile-able.
I ran into a situation in which I needed to branch based on the form of a specified object reference (named/index/id). Getting the reference form is obscure but relatively easy (coerce the reference to a record and grab the <<class form>> property). From there, I need to compare the form to a constant (e.g. - <<constant ****name>>).
I just tried this as an experiment, just to see what would happen. I don't know if this has anything to do with your problem, so it may not be helpful. Before trashing, here is my script ...
property itemAlias : alias "OS_X:Users:lutherfuller:Desktop:Wrong American University System.pdf"
(*
on run
tell application "Finder"
set itemClass to (class of item itemAlias) as text --> "«class docf»"
(itemClass = "«class docf»") as text --> true, false
end tell
display dialog itemClass & return & the result
end run --------------
*)
on run
tell application "Finder"
set itemClass to (class of item itemAlias) --> document file
(itemClass = document file) as text --> true, false
end tell
display dialog (itemClass as text) & return & the result
end run
-- both dialogs return ... «class docf»
-- true
-- if you run by double-clicking the saved application
-- both dialogs return ... document file
-- true
-- if you run from the Smile editor