• 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: Axel Luttgens <email@hidden>
  • Date: Thu, 26 May 2011 23:05:25 +0200

Le 26 mai 2011 à 14:49, Luther Fuller a écrit :

> [...]
>
> My choice of subject was misleading. I am (not yet) using load script, only 'run script ...'.
>
> When I use 'run script ...', I find that ...
> 1. Handlers in the parent (calling) script are available in the called script.
>    (Use of 'my' is optional and has nothing to do with my problem.)
> 2. Properties in the parent (calling) script are NOT available in the called script.
>    (But they ARE available within a parent handler used in the called script.)
>
> [...]

OK, I guess some miscommunications occurred throughout this thread...
Because of differing runtime environments.

Save this one as B.scpt on the desktop:

	DoThat()

Now, save this one as A.app, but keep it open in AppleScript Editor as well:

	on DoThat()
		return "DoThat() in main script"
	end DoThat

	display dialog (run script alias (((path to desktop) as text) & "B.scpt"))

Running A in AppleScript Editor yields an error:

	"«script» ne comprend pas le message DoThat." number -1708 from alias "Boot:Users:luttgens:Desktop:B.scpt"

while double-clicking A.app displays a dialog with following text:

	DoThat() in main script

That is, handlers in the calling script are indeed available to the called script (through "run script") when the calling script is run as an application.

Now, I tend to believe that it is more by accident than anything else, since "run script" normally tends to create its own, independent environment (hence the non availability of the caller's properties).
But I may be wrong...

Axel





 _______________________________________________
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

  • Follow-Ups:
    • Re: Load Script
      • From: Luther Fuller <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: Alex Zavatone <email@hidden>)
 >Re: Load Script (From: Luther Fuller <email@hidden>)
 >Re: Load Script (From: Ron Hunsinger <email@hidden>)
 >Re: Load Script (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: set volume from shell
  • Next by Date: Re: Load Script
  • Previous by thread: Re: set volume from shell
  • Next by thread: Re: Load Script
  • Index(es):
    • Date
    • Thread