Re: run load script - technique
Re: run load script - technique
- Subject: Re: run load script - technique
- From: Deivy Petrescu <email@hidden>
- Date: Tue, 07 Jun 2011 16:31:34 -0400
On Jun 7, 2011, at 15:09 , Luther Fuller wrote:
> In case anyone tries the technique for calling a .scpt file in /Resources/MenuItemScripts/ with an application in /Resources/MenuItemAppls/, here is something you should know. (And I just discovered.)
>
> You will want some of these menu item applications to show their icon in the Dock until finished, while others should not appear in the Dock.
>
> If you DO NOT want the menu item to appear in the Dock, then use this template for it's application:
>
> -- this application located in /Application/Contents/Resources/MenuItemAppls/
> -- compile with LSUIElement = true, does NOT show icon in Dock.
> on run
> tell application "Finder" to set hostAppl to (container of container of container of container of (path to me)) as text
> ignoring application responses
> launch application hostAppl
> tell application hostAppl to runMenuItem("Inspect")
> end ignoring -- quits immediately, does not wait for runMenuItem to respond.
> end run -----------------------------
>
> If you DO want the menu item to appear in the Dock, then use this template for it's application:
>
> -- this application located in /Application/Contents/Resources/MenuItemAppls/
> -- compile with LSUIElement = false, does show icon in Dock.
> on run
> tell application "Finder"
> activate -- so this appls menubar will not show. (May activate another appropriate application.)
> set hostAppl to (container of container of container of container of (path to me)) as text
> end tell
> with timeout of 100000 seconds -- a very long time. Avoids the 2 min warning.
> launch application hostAppl
> tell application hostAppl to runMenuItem("Burn")
> end timeout -- quits only after 'Burn.scpt' has finished.
> end run -----------------------------
>
There is another bit of information that might be useful too.
It was my experience that if it does not show in the dock, it does not show in app switcher as well.
That is, cmd-tab will not show the application icon.
Deivy Petrescu
email@hidden
_______________________________________________
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