• 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: Load Script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Load Script


  • Subject: Re: Load Script
  • From: Luther Fuller <email@hidden>
  • Date: Thu, 26 May 2011 09:53:40 -0500

More experimenting.
When a script file is called this way ...

tell application "Finder" to (file "called.scpt" of container of (path to me)) as alias
run (load script the result)


handlers and properties in the parent calling script are available in the called script.


If you try to use either of these examples ...

(*
tell application "Finder" to (file "called.scpt" of container of (path to me)) as alias
run script the result -- properties are unavailable.
*)


(*
tell application "Finder" to (file "called.scpt" of container of (path to me)) as alias
run script (load script the result) -- properties are unavailable.
*)

handlers, but NOT properties, are available in the called script. In other words, avoid using 'run script ...'.

'run script' is defined in the Standard Additions dictionary, while 'run' is in the AppleScript dictionary and only applies to applications. This is why I trust experiments and not the dictionaries.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Load Script (From: Luther Fuller <email@hidden>)
 >Re: Load Script (From: Stan Cleveland <email@hidden>)
 >Re: Load Script (From: Luther Fuller <email@hidden>)
 >Re: Load Script (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Load Script
  • Next by Date: Re: tell app, name in string var
  • Previous by thread: Re: Load Script
  • Next by thread: Re: Load Script
  • Index(es):
    • Date
    • Thread