• 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: Sun, 29 May 2011 12:02:26 +0200

Le 28 mai 2011 à 13:47, Luther Fuller a écrit :

> [...]
> The entryPointHandler should also contain a master error catcher, like this ...
>
> [...]

Yes, I simplified the code so as to focus on the overall logics.


> Does it accurately mimic my code? I think you've got it!

OK, we thus are speaking about the same things now. ;-)

As discussed previously, this relies on a rather obscure behavior gained when a calling script (here DiskImages.app) is run as an application (as launched by Burn.app): thanks to this, the called script (here Burn.scpt) gets somehow embedded into the caller's environment.

Moreover, I can't get out of my mind that this appears somewhat convoluted and unstructured.

So, my question is: would you lose some capabilities by just putting your common code into a separate script, as in following alternate skeleton?

Script of DiskImages.app, the "main" application:

	on run
		installMe()
	end run

	on installMe()
		-- Install in Application Support, Dock...
		display dialog "Install done!"
	end installMe

Script of DiskImages.app/Contents/Resources/MenuItemAppls/Burn.app:

	on run
		tell application "Finder" to get (item "CommonCode.scpt" of folder "Scripts" of container of container of (path to me)) as alias
		set CC to load script result
		CC's Common()
		Burn()
	end run

	on Burn()
		display dialog "Burning..."
	end Burn

Script of DiskImages.app/Contents/Resources/Scripts/CommonCode.scpt:

	on Common()
		display dialog "Performing common code..."
	end Common

BTW, wasn't this your initial idea at the very beginning of this thread? Kind of looping here...

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

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>)
 >Re: Load Script (From: Axel Luttgens <email@hidden>)
 >Re: Load Script (From: Luther Fuller <email@hidden>)
 >Re: Load Script (From: Axel Luttgens <email@hidden>)
 >Re: Load Script (From: Luther Fuller <email@hidden>)
 >Re: Load Script (From: Axel Luttgens <email@hidden>)
 >Re: Load Script (From: Luther Fuller <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