Can Livecode Create Menubar Apps?

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
icouto
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 92
Joined: Wed May 29, 2013 1:54 am
Location: Sydney, Australia

Can Livecode Create Menubar Apps?

Post by icouto » Mon Sep 23, 2019 9:47 am

Hi all,

I was wondering whether LiveCode is able to create menubar utility apps for MacOS - you know, apps that add a menu item to the LEFT side of the global menubar (like Dash, SkyFonts, 1Password, etc.).

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can Livecode Create Menubar Apps?

Post by richmond62 » Mon Sep 23, 2019 10:09 am

I do know that LiveCode apps cannot send low-level signals to the operating system . . .

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Can Livecode Create Menubar Apps?

Post by bogs » Mon Sep 23, 2019 11:34 am

Thankfully, doing what your looking to do shouldn't require that :wink:

I don't have a Mac, so I can't answer your question definitively. I believe Lc on Windows *can* make system tray programs. I don't believe this is possible on 'nix (not sure why), I don't know if it is possible on the Mac menubar area.
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Can Livecode Create Menubar Apps?

Post by jacque » Mon Sep 23, 2019 5:26 pm

Using native LC scripting, system menus aren't supported on Macs but it could be done with LC Builder. Trevor Devore took a shot at it but I'm not sure how far he got. You might ask him:

viewtopic.php?t=30983
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Can Livecode Create Menubar Apps?

Post by Klaus » Mon Sep 23, 2019 6:19 pm

Nowadays LC supports a Mac Status Menu, maybe that helps?
Look under "Mac Status Menu" in the dictionary.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can Livecode Create Menubar Apps?

Post by richmond62 » Mon Sep 23, 2019 7:12 pm

Screenshot 2019-09-23 at 21.11.24.png
-
Presumably all the creation routines have to subsist in a stack that is invisible, and is running in the
background.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Can Livecode Create Menubar Apps?

Post by jacque » Mon Sep 23, 2019 8:06 pm

Klaus wrote:
Mon Sep 23, 2019 6:19 pm
Nowadays LC supports a Mac Status Menu, maybe that helps?
Look under "Mac Status Menu" in the dictionary.
Well cool, I completely missed that. I wonder when that was added, there's no date in the dictionary entries. So the answer is "yes you can do that."
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can Livecode Create Menubar Apps?

Post by richmond62 » Mon Sep 23, 2019 8:14 pm

So the answer is "yes you can do that."
But the "funny" thing is that when I went:

Code: Select all

on openStack
   macStatusMenuCreate "Richmond"
   macStatusMenuSetCustomIcon "R", the long id of img "RR"
end openStack
I was told, subsequently that a menu 'thing' had
been created: but there was NO sign of it anywhere.
-
Screenshot 2019-09-23 at 22.14.42.png

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Can Livecode Create Menubar Apps?

Post by Klaus » Mon Sep 23, 2019 8:22 pm

jacque wrote:
Mon Sep 23, 2019 8:06 pm
Klaus wrote:
Mon Sep 23, 2019 6:19 pm
Nowadays LC supports a Mac Status Menu, maybe that helps?
Look under "Mac Status Menu" in the dictionary.
Well cool, I completely missed that. I wonder when that was added, there's no date in the dictionary entries. So the answer is "yes you can do that."
I think it came with 9.5.
BTW: Trevor De Vore made it!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Can Livecode Create Menubar Apps?

Post by jacque » Tue Sep 24, 2019 4:23 pm

BTW: Trevor De Vore made it!
I am not the least bit surprised. If I ever need LCB stuff I know who to call.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

PBH
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 129
Joined: Sun Feb 20, 2011 4:26 pm
Location: Vancouver Island, BC, Canada. ex.UK
Contact:

Re: Can Livecode Create Menubar Apps?

Post by PBH » Tue Sep 24, 2019 7:01 pm

richmond62 wrote:
Mon Sep 23, 2019 8:14 pm
I was told, subsequently that a menu 'thing' had
been created: but there was NO sign of it anywhere.
Could it be because you didn't populate the menu? I'm not too sure!
Anyway, I had a play and it seems to work fine, so I've added a sample stack for the benefit of everyone here.
Requires minimum LC9.5.x - Build 15503 or later, on Mac.
Have fun. :)
Attachments
Mac Menu Sampler.livecode.zip
(3.28 KiB) Downloaded 331 times
Last edited by PBH on Wed Sep 25, 2019 11:22 pm, edited 1 time in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Can Livecode Create Menubar Apps?

Post by dunbarx » Wed Sep 25, 2019 3:02 pm

PBH

Hi.

Your stack throws an error. There is no function "macStatusMenuNames()" in the mouseUp script. Or anywhere else, it seems.

Craig

PBH
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 129
Joined: Sun Feb 20, 2011 4:26 pm
Location: Vancouver Island, BC, Canada. ex.UK
Contact:

Re: Can Livecode Create Menubar Apps?

Post by PBH » Wed Sep 25, 2019 4:40 pm

Hi Craig,

macStatusMenuNames() is in the Mac Status Menu Library supplied in the latest LC9.5.0. The version I have is Build 15503 which appears to be the most up-to-date "stable" version of LC.

HTH :)

Paul

smelly
Posts: 14
Joined: Sat Jan 09, 2021 11:36 pm

Re: Can Livecode Create Menubar Apps?

Post by smelly » Fri Oct 22, 2021 12:37 am

@ dunbarx

I ran the Mac Menu Sampler.livecode and it worked well for me. I'm using LC 9.6.3. I think the current version is 9.6.4 or 5. I have an LC Mac app I'm developing in which I was looking for a way my users can give commands to my app while busy using some other app, such as a text editor, browser, or whatever.

My LC app plays music in the background and I want the user to be able to control the music (play, stop, et. al.) without changing the foreground app to my music player and then back again to what they were working on. I think this Mac Status Menu utility is just what I need. Alternatively, I have implemented this background command capability in utilities such as Applescript and Keyboard Maestro with associated keyboard shortcuts, but these add excessive complications for the less sophisticated users. Optimally, I'd like to see if I can figure out a way to add keyboard shortcuts to the LC Mac Status Menu so my users can have some universal keyboard shortcuts to control the music player, whatever other program they might be using. Anybody know how I can do that?

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Can Livecode Create Menubar Apps?

Post by Klaus » Fri Oct 22, 2021 9:46 am

Hi Igor(?),
icouto wrote:
Mon Sep 23, 2019 9:47 am
Hi all,

I was wondering whether LiveCode is able to create menubar utility apps for MacOS - you know, apps that add a menu item to the LEFT side of the global menubar (like Dash, SkyFonts, 1Password, etc.).
LC can only create a menubar utility in and for its own standalone, not for other applications or the macOS in general!
So the correct answer to your question will be no.


Best

Klaus

Post Reply

Return to “Mac OS”