Re: Converting application classes to raw codes in chevrons
Re: Converting application classes to raw codes in chevrons
- Subject: Re: Converting application classes to raw codes in chevrons
- From: Christopher Nebel <email@hidden>
- Date: Mon, 2 Oct 2006 10:38:49 -0700
On Oct 2, 2006, at 8:11 AM, T&B wrote:
How can I convert application specific class names to raw Apple
Event codes (in chevrons etc), so I can use them outside of a tell
app block?
For instance, if I tell AppleWorks to get the properties of a
graphic object ... how can I get the bounds, fill color etc of
myProperties outside of a tell app block? I think I need to use the
raw codes of those classes, such as:
tell application "AppleWorks 6"
tell drawing area of front document
set myProperties to properties of graphic object 1
end tell
end tell
set myBounds to <<boundsClass>> of myProperties
set myFillColor to <<fillColorClass>> of myProperties
But how can I find out what <<boundsClass>> and <<fillColorClass>>
are really supposed to be?
Years ago I did this by deleting the target app, opening the script
in Script Editor, and choosing SimpleText (which had no scripting
dictionary), to force it to decompile the AppleScript code words.
Does that still work? Is there a better way?
The old technique of deleting the application still works; another
way is to use Smile (and, I think, Script Debugger), which supports
this sort of thing as a feature. Of course, a related question is
why do you need to do this in the first place? In your example,
moving the two "set" commands inside the "tell" block will not change
the semantics of the script -- it won't send an event for them either
way. If in your real code the "tell" block is some distance away,
you could always add one, and it still won't cause the "set" commands
to send an event.
--Chris Nebel
AppleScript Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden