Re: Cocoa scripting support - background helper app
Re: Cocoa scripting support - background helper app
- Subject: Re: Cocoa scripting support - background helper app
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 11 Apr 2010 10:52:14 -0400
On Apr 11, 2010, at 10:14 AM, email@hidden wrote:
> My questions are:
>
> 1. Presumably I have to target a fully fledged application bundle and cannot somehow route my AE requests to the foundation tool itself.
>
> 2. Can I embed the helper app in the main app bundle and engineer some way for AppleScript to be able to target it?
> I seem to remember reading something about app bundles enclosed with other apps but cannot recall it.
> I don't really want to have two external app bundles.
>
> 3.When configuring a Cocoa app to behave like Image events.app is it sufficient just to declare LSBackgroundOnly = "1" in the info.plist?
My PreFab UI Actions product consists of a standard application with a full-fledged GUI, plus a scriptable "faceless background application" (FBA). The FBA acts somewhat like a traditional scripting addition (OSAX), but it is actually a standard Cocoa application package with LSUIElement = 1. Because the FBA serves the same overall purpose as a scripting addition, my main application installs it in the user or local ScriptingAdditions folder. The main application gives the user an option to launch the FBA every time the computer starts up, and of course the FBA is automatically launched any time an AppleScript 'tell' command is directed to it.
I use LSUIElement = 1 to keep the FBA out of the Dock, etc. I do NOT use LSBackgroundOnly = 1, because I want the FBA to be able to present an alert from time to time, and when I do that I bring it to the front for easy user input.
This is a fairly common pattern.
--
Bill Cheeseman
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden