App name automatically changing in About menu?

I’m setting up a new template and my app’s name is not automatically appearing in the About menu. I can of course add it manually, but basically I want it to change automatically whenever I rename the app. Is this possible?

It seems it should be possible as the Quit menu can do it …

Umm but … it does ?
What name are you changing that you’re not seeing it automagically change ?
If you change Build Settings > macOS > Mac App Name that is whats used and should change the About menu item automatically

Doesn’t do it for me.

Following the instructions at

Menu is called AboutMenu
It is in the HelpMenu which is the rightmost menu
Super is ApplicationMenuItem
Text is #kAbout

Public Const kAbout as String = About

All I get is “About” without the app name.

Using Xojo 2018R3 on MacOS 10.14.6

ah … yeah ok … let me pull my head out of my ass … :stuck_out_tongue:

Are plugins OK or no ?

This is one of those things you’d think that would be handled automatically but … its not

if you can use MBS then you can, in the app open event, put something like

AboutMenu.Text = kAbout+ " " + me.ApplicationNameMBS

basically it grabs the app name from the bundle - which you can do without a plugin if thats the way you want to go

Windows is harder since there is no bundle to read from

So a workable alternative on all platforms is to define a global constant

kAppName = "Markus App"

and then use #kAppName in the Build Settings > macOS > Mac App Name and the same for the others (except you do need a constant with multiple values but NOT a dynamic constant and the Windows one needs to have a .exe extension)

Its kind of messy but its as close as you get


Yes, I have the MBS plug-ins, so no problem there.

But what about the BundleIdentifier? Can’t use a # in there, can’t set it in code.

My feeling is that is something that Xojo should handle automatically.

best you might do is a prebuild step with a script to set it
or a postbuild to alter the built plist

A lot of stuff like that is automatically handled by App Kit (on the macOS). I’ve tried my best to tap into it, in some cases I can get halfway there (like the Window menu), but things like this need a little extra.

I have it set-up so that it reads the app name from the NSApplication class and updates the menuitem on launch. It’s part of the code that I’m selling with this years OmegaBundle if you’re interested.

I am. However I am putting together an app template that I wanted to put on GitHub (if I ever get the hang of Git), so for myself adding commercial plugins is fine but for the open source version it’s a bit of a no-go.

a general purpose app template to start from that has a lot of useful bits built in would be a good thing

heres a tiny contribution

Do with it what you will

1 Like