Passing Reference of App "C" From App "B" to App "A"?
Passing Reference of App "C" From App "B" to App "A"?
- Subject: Passing Reference of App "C" From App "B" to App "A"?
- From: Brett Kirksey <email@hidden>
- Date: Sun, 12 Sep 2004 23:10:36 -0400
I'm working on a script library saved as an application. I've
ran into something I can't figure out, so I thought one of you
guys may know what's going on.
Here's an example. Let's say you make a script with only the
following code:
on makeFinderWindow()
tell application "Finder"
set bar to make new Finder window
return bar
end tell
end makeFinderWindow
Now save it as a script _application_ named "Foo".
Now make another script with only this code:
set newWindow to makeFinderWindow() of application "Foo"
tell application "Finder" to close newWindow
Run this script. It generates an error that <<class brow>>
doesn't understand the close command. If you comment out the
"close window" command, you can see the result of the script is
"Finder window id nn of application 'Foo'".
But if you run the handler makeFinderWindow() from within "Foo",
the result is "Finder window id nn of application 'Finder'". So,
when "Foo" passes the new finder window of "Finder" to the
calling script, it becomes a finder window of "Foo" instead and
then you can't work with it.
I've tried this with several different apps and several
different classes of objects, and it does the same thing. I just
know I'm missing something obvious, so I'm feeling pretty dumb.
Can someone enlighten me?
BTW, I know you can make script libraries out of compiled
scripts instead of apps. Right now, I'm more interested in why
this behavior is occurring than how to get my script library
working.
Thanks
--
Brett
_______________________________________________
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