• 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: Inheritance and Loaded Libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inheritance and Loaded Libraries


  • Subject: Re: Inheritance and Loaded Libraries
  • From: has <email@hidden>
  • Date: Thu, 28 Oct 2004 10:26:27 +0100

David Weiss wrote:

I'm totally confused. Why doesn't this work?

Because you need to get a copy of the script object stored in ScriptRunner's XLib property from the application before you locally call its handlers. Nothing to do with inheritance or loaded libraries; you just need to send the 'get' event at the right place. You're dealing with plain old AppleScript here, not the Apple Event Object Model, so don't assume it'll behave the same as a scriptable application because it won't.



I've got a 3 part AppleScript system:

[snip]
To have Script Runner run a copy of myScript while giving that script direct access to its own state - which is what I assume you want to do - use the following solution:



Exhibit 1 - The Script Runner: An AppleScript Appliction

property XLib : missing value

on runScript(theScript)
	set XLib to (load script ("Macintosh
HD:Users:davidweiss:Desktop:ALib.scpt" as alias))
	theScript's main(me)
	quit
end runScript

Exhibit 3 - The Script: A text script

script myScript
	on main(runnerScript)
		runnerScript's XLib's runTest()
	end main
end script

tell application "ScriptRunner" to runScript(myScript)


Not that there's many circumstances in which you'd want or need to write code this way. The only use I can think of is if you're sending scripts to a remote machine to be executed there. There's easier ways to do most anything else.


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


  • Follow-Ups:
    • Re: Inheritance and Loaded Libraries
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Inheritance and Loaded Libraries
  • Next by Date: Re: Open Files for Illustrator
  • Previous by thread: Re: Inheritance and Loaded Libraries
  • Next by thread: Re: Inheritance and Loaded Libraries
  • Index(es):
    • Date
    • Thread