Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Creating Menulets?

Creating Menulets?
Thread Tools
CEO
Fresh-Faced Recruit
Join Date: Nov 2005
Status: Offline
Reply With Quote
Nov 2, 2005, 02:49 PM
 
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?
     
Scandalous Ion Cannon
Mac Elite
Join Date: Aug 2005
Status: Offline
Reply With Quote
Nov 2, 2005, 04:12 PM
 
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."
     
TETENAL
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Nov 2, 2005, 04:25 PM
 
/Applications/AppleScript Utility

->Show Script Menu in menu bar
->Open script folder

And then drop your script into the script folder.
     
brokenjago
Mac Elite
Join Date: Sep 2005
Location: Los Angeles, California
Status: Offline
Reply With Quote
Nov 2, 2005, 04:28 PM
 
err

For those who are a little un-versed with AppleScript, what's a menulet?
Linkinus is king.
     
bkb
Dedicated MacNNer
Join Date: Sep 2003
Status: Offline
Reply With Quote
Nov 2, 2005, 09:22 PM
 
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
     
bkb
Dedicated MacNNer
Join Date: Sep 2003
Status: Offline
Reply With Quote
Nov 2, 2005, 09:23 PM
 
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
     
brokenjago
Mac Elite
Join Date: Sep 2005
Location: Los Angeles, California
Status: Offline
Reply With Quote
Nov 2, 2005, 10:52 PM
 
OH.

Sexy.
Linkinus is king.
     
CEO  (op)
Fresh-Faced Recruit
Join Date: Nov 2005
Status: Offline
Reply With Quote
Nov 2, 2005, 10:55 PM
 
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?
     
CEO  (op)
Fresh-Faced Recruit
Join Date: Nov 2005
Status: Offline
Reply With Quote
Nov 2, 2005, 10:56 PM
 
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?
     
Diggory Laycock
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Nov 3, 2005, 04:06 AM
 
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. )
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Nov 3, 2005, 11:54 AM
 
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'."
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Nov 3, 2005, 01:49 PM
 
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
     
Diggory Laycock
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Nov 3, 2005, 02:04 PM
 
     
goMac
Posting Junkie
Join Date: May 2001
Location: Portland, OR
Status: Offline
Reply With Quote
Nov 3, 2005, 03:58 PM
 
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?
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Nov 4, 2005, 12:27 PM
 
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 Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:58 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,