Monday, December 10, 2018

#1 2017-12-30 04:01:43 pm

mauricioa
Member
Registered: 2017-12-30
Posts: 7

Menubar Simple Controller

I had to paste the script in a pastebin, as this website parses out anything after the icons.

These are emoticons from a Font that OSX has. How can I use images from icns or png in the menu?  Is it possible?

Script: https://pastebin.com/SUzpSQZb

Preview:
Screen_Shot_2017-12-30_at_8.09.54_PM.png

Last edited by mauricioa (2017-12-30 09:33:09 pm)


Filed under: applescript, menubar

Offline

 

#2 2017-12-31 06:59:21 am

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5479

Re: Menubar Simple Controller

You basically need to use -setImage:. So:

Applescript:

someMenuItem's setImage:(current application's NSImage's alloc()'s initWithContentsOfFile:"/path/to/image/file")


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Online

 

#3 2017-12-31 08:30:16 pm

mauricioa
Member
Registered: 2017-12-30
Posts: 7

Re: Menubar Simple Controller

I was be able set the top level menu icon with that, the one that shows in the bar.

But not the menu items. These:

set menuList to {"Filter Hosts", "Clean Filters", "", "Walle", "Quit"}

Offline

 

#4 2017-12-31 09:52:32 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5479

Re: Menubar Simple Controller

You have to address the menu items.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Online

 

#5 2018-01-01 08:21:14 am

mauricioa
Member
Registered: 2017-12-30
Posts: 7

Re: Menubar Simple Controller

Not a go.. errors by the bundles.
I'll leave as is, is not perfect but I guess does what supposed to to. If I run out of white icons I'll simply remove them all.

Thanks man

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)