Stripping the target application specifier from an AppleScript object reference
Stripping the target application specifier from an AppleScript object reference
- Subject: Stripping the target application specifier from an AppleScript object reference
- From: "Scott Babcock" <email@hidden>
- Date: Mon, 2 May 2005 13:16:41 -0700
- Thread-topic: Stripping the target application specifier from an AppleScript object reference
I have a scenario where I want to take a reference to a System Events
object and send it to a different application. The problem I was having
was that System Events kept throwing a wrench in the works by trying and
failing to perform an unnecessary coercion.
I found that I can strip the target process specifier by coercing a
reference to a list in base context - that is, outside of a 'tell'
block:
set strippedRef to (item 1 of (originalRef as list))
Once I do this, I have the original reference minus the phrase 'of
application "System Events"'. I can pass this reference around wherever
I want, and System Events is none the wiser.
Once I get this reference to my scriptable application, I can get the
container (parent) of the reference and add the target process specifier
back on, giving me a usable container-object reference.
The question is this: Is the target-stripping side-effect of list
coercion a know behavior, or is this a bug that Apple may "fix" some
day?
_______________________________________________
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