|
|
Creating Menulets?
|
|
|
|
Fresh-Faced Recruit
Join Date: Nov 2005
Status:
Offline
|
|
Dear good people of the MacNN forms,
I did a search and didn't find this posted before so... I have a compiled apple script that I would like to turn into a menulet. How do I go about doing this?
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Aug 2005
Status:
Offline
|
|
I think Apple puts quite a bit of effort into not allowing people to do this.
|
"That's okay, I'd like to keep it on manual control for a while."
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status:
Offline
|
|
/Applications/AppleScript Utility
->Show Script Menu in menu bar
->Open script folder
And then drop your script into the script folder.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2005
Location: Los Angeles, California
Status:
Offline
|
|
err
For those who are a little un-versed with AppleScript, what's a menulet?
|
Linkinus is king.
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Sep 2003
Status:
Offline
|
|
Originally Posted by TETENAL
/Applications/AppleScript Utility
->Show Script Menu in menu bar
->Open script folder
And then drop your script into the script folder.
Er... I think he means creating a new menulet entirely, rather than dropping the script into the Scripts menulets.
|
PBG4/12"/1GHz/1.25GB/60GB//SD/APX/10.3
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Sep 2003
Status:
Offline
|
|
Originally Posted by brokenjago
err
For those who are a little un-versed with AppleScript, what's a menulet?
They are the icons in the right corner of the Menu bar. Clock, Airport, Bluetooth, etc...
|
PBG4/12"/1GHz/1.25GB/60GB//SD/APX/10.3
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2005
Location: Los Angeles, California
Status:
Offline
|
|
|
Linkinus is king.
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Nov 2005
Status:
Offline
|
|
Originally Posted by Scandalous Ion Cannon
I think Apple puts quite a bit of effort into not allowing people to do this.
Your right, sort of. They do make it very obscure, not allowing people to make their own "moveable" menulets by undisclosing the API. Though they do document one API, called NSStatusItem, that will allow to build your own menulet in Cocoa. Thats how the people at Google made the Gmail Notifier. Notice how the notifier is umovable when you cmd-click it.
Now what I want to do is simply make a menulet that calls a complied apple script.
Any ideas out there Cocoa gurus?
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Nov 2005
Status:
Offline
|
|
Originally Posted by Scandalous Ion Cannon
I think Apple puts quite a bit of effort into not allowing people to do this.
Your right, sort of. They do make it very obscure, not allowing people to make their own "moveable" menulets by undisclosing the API. Though they do document one API, called NSStatusItem, that will allow to build your own menulet in Cocoa. Thats how the people at Google made the Gmail Notifier. Notice how the notifier is umovable when you cmd-click it.
Now what I want to do is simply make a menulet that calls a complied apple script.
Any ideas out there Cocoa gurus?
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
To do it 'officially' - you'd want to make a simple invisible cocoa app (add LSUIElement = 1 to the info.plist) - that initialises a new NSStatusItem on start. (and releases it on quit.)
Add one menu item to your menu - the action for the menu item should then execute the script.
http://developer.apple.com/documenta...pleScript.html
http://developer.apple.com/documenta...tatusItem.html
p.s. ideally this should be in the developer forum.
Wouldn't it be easier just to stick a script in the ~/Library/Scritps/ directory and use the Script Menu Extra?
(
Last edited by Diggory Laycock; Nov 3, 2005 at 12:03 PM.
)
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally Posted by Diggory Laycock
Wouldn't it be easier just to stick a script in the ~/Library/Scritps/ directory and use the Script Menu Extra?
Or the Dock if you want one-click access.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status:
Offline
|
|
Originally Posted by Diggory Laycock
To do it 'officially' - you'd want to make a simple invisible cocoa app (add LSUIElement = 1 to the info.plist) - that initialises a new NSStatusItem on start. (and releases it on quit.)
I'm almost certain that it's NSUIElement, not LSUIElement
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: May 2001
Location: Portland, OR
Status:
Offline
|
|
NSUIElement will also work but I believe it's been deprecated. In the Mac OS 10.0-10.2 days it was the official way of doing it.
|
8 Core 2.8 ghz Mac Pro/GF8800/2 23" Cinema Displays, 3.06 ghz Macbook Pro
Once you wanted revolution, now you're the institution, how's it feel to be the man?
|
|
|
|
|
|
|
|
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status:
Offline
|
|
After checking a bit, you're right that NSUIElement is deprecated but still works and is even used by Apple in current apps. For those who are intrested, there is this thread about it at Cocoabuilder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|