• 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: Launching one Applescript app with another Applescript app fails in OS X 10.8
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Launching one Applescript app with another Applescript app fails in OS X 10.8 (From: Jim Skibbie <email@hidden>)

  • Prev by Date: Re: Launching one Applescript app with another Applescript app fails in OS X 10.8
  • Next by Date: Re: Launching one Applescript app with another Applescript app fails in OS X 10.8
  • Previous by thread: Re: Launching one Applescript app with another Applescript app fails in OS X 10.8
  • Next by thread: Script to force iTunes'11 to start and check for App updates
  • Index(es):
    • Date
    • Thread