Re: How to reliably target a helper app that's inside a bundle?
Re: How to reliably target a helper app that's inside a bundle?
- Subject: Re: How to reliably target a helper app that's inside a bundle?
- From: "Stockly, Ed" <email@hidden>
- Date: Mon, 19 Oct 2009 17:47:34 -0700
- Thread-topic: How to reliably target a helper app that's inside a bundle?
> So, if I make sure my "tell" application path is correct, there should be no
risk to hard coding just the helper app name in "using terms from", so long as
I compile it successfully my own machine with 'osacompile -x'?
Yes. With "using terms from" the "hard coded" helper app name is used to
compile the script when you are editing it on your mac, it is irrelevant at
runtime. As long as the version of the helper app appleScript finds on your
mac has the same terminology as the helper app at runtime, then that part of
it will work.
>>My main app can easily use -[NSBundle pathForResource...] to find the
helper app. From Luther's example (thanks!) it looks like it will be
cleaner just to pass the helper app's path into my script instead of
messing with Finder containers. But it's good to know that this is
considered a safe thing to do.
Here's how one could do it with appleScript:
--------
Set helperAppName to "MyHelperApp"
Set scriptPath to path to me as text
Set text item delimiters to ":"
Set helperAppPath to text items 1 thru -2 of scriptPath & helperAppName
Tell application helperAppPath
Etc.
----------
You could also use posix paths in a similar way.
HTH,
ES
_______________________________________________
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