Re: Launching one Applescript app with another Applescript app fails in OS X 10.8
Re: Launching one Applescript app with another Applescript app fails in OS X 10.8
- Subject: Re: Launching one Applescript app with another Applescript app fails in OS X 10.8
- From: Luther Fuller <email@hidden>
- Date: Thu, 04 Apr 2013 14:03:57 -0500
This discussion reminded me of the fix I used for this problem.
The CALLING script, that formerly used 'launch', now looks like this ...
on run tell application "Finder" to set hostAppl to (container of container of container of (path to me)) as alias try set menuItemScript to load script hostAppl tell menuItemScript to saveSelectedMessages() on error errText number errNr activate me if errNr = -128 then return "saveSelectedMessages Error = " & errNr & return & errText tell me to display dialog the result buttons {"OK"} default button 1 end try end run -----------------------------
(The calling script is an application within the 'Contents/Resources/ folder in the main (CALLED) application)
This avoids 'run'-ing the loaded script, but it involved writing new handlers in hostAppl . Some handlers in the old hostAppl used
set selfRef to (path to me)
which no longer works in a loaded script, so I had to write a few new handlers replacing this with
tell application "Finder" to set selfRef to (container of container of container of (path to me)) as alias
If you are calling handlers in a script without a run handler, it would be better to use this technique by saving these handlers within a .scpt file, then 'load' the .scpt file.
|
_______________________________________________
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