• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AppleScript Challenge
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript Challenge


  • Subject: Re: AppleScript Challenge
  • From: has <email@hidden>
  • Date: Sun, 3 Oct 2004 19:18:39 +0100

Axel Luttgens wrote:

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?

It is a consequence of the object paradigm (as implemented by AppleScript, would some people add).

Actually, it's a limitation of the Apple Event Manager's 'object specifier' type, used to construct references to an application's object model. Object specifiers don't hold any information about the application whose object model they refer to. When an application returns a reference, AppleScript has to assume that this reference refers to the application that returned it; it has no way of knowing otherwise. This is not a 100% safe assumption, however, as the OP has found out.


The OP's best options are 1. save his 'Foo' script as a library and import that into his main script, or 2. modify the makeFinderWindow handler so it returns a non-reference value (the window's unique id would be ideal), both of which are easy enough to do.

HTH

has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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


  • Prev by Date: Re: Spellcheck a list
  • Next by Date: Re: re. footnotes [was Re: Variable Ponderance]
  • Previous by thread: Re: AppleScript Challenge
  • Next by thread: finding the last used app
  • Index(es):
    • Date
    • Thread