How to know the app name?

Hello all,
Is there a way to find the App’s name programmatically?


There’s two ways.

  1. Using pure Xojo, you can get the file name of the executable from app.executableFile (or whatever it is now called). Please note that the file name can and in some circumstances differ from what the actual customer will see, so this isn’t recommended.
  2. Use Declares to dig into the operating system API and extract the name as it is displayed to the customer.
    Here’s the Apple API for doing just that.
    localizedName | Apple Developer Documentation

I did make the declares available with OAK, but that was before the Xojo APIcalypse broke most of it.

Return app.ApplicationNameMBS.Trim(".debug")


Thanks for your response the chuckle Sam!
I need it for internal use, nothing customer facing…


1 Like

Nice and simple trick to accommodate the function at debug times.
(just never release an app which contains “.debug” on purpose, but that’s not likely going to be frequent…)