How to reliably target a helper app that's inside a bundle?
How to reliably target a helper app that's inside a bundle?
- Subject: How to reliably target a helper app that's inside a bundle?
- From: Nathan Vander Wilt <email@hidden>
- Date: Mon, 19 Oct 2009 14:10:35 -0700
My main application bundles an AppleScript script and scriptable
helper application.
These get bundled in the Resources folder of my main app's bundle like
so:
MainApp
|-Resources
|-HelperApp
|-script
My MainApp calls the script to do some work, and the script uses the
HelperApp to offload some work that was much more efficiently done in
Cocoa. The problem is that the script can't find the HelperApp when it
is deployed inside of the Resources folder of MainApp.
I could get the path of my HelperApp by either passing it as an
argument to the script, or using "path to me". (Is the latter
reliable? I know in many contexts relying on the executable path is
strongly discouraged.)
But with either of those solutions I would need to implement this by
replacing all occurrences of:
tell "HelperApp"
-- instructions
end tell
with:
global theHelperApp
set theHelperApp to application path "..."
tell theHelperApp
using terms from "HelperApp"
-- instructions
end using terms
end tell
My worry with doing this is that this still won't help osacompile find
"HelperApp" during script compilation. How can I be sure that my
script will always compile to the most current HelperApp's scripting
definition? Is there a better way to approach this?
thanks,
-natevw
_______________________________________________
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