Xojo - some pieces 4u
macOS: App Directories 0.7.3
- Read the Description
Download and try it yourself
Do you like it? Does it help you? Has it saved you time and money?
You're welcome - it's free... If you want to say thanks I appreciate a message or a small donation.
macOS Catalina consists of two Volumes. A read-only System volume, and a read-write Data volume.
So the classic '/Applications' directory is now the one where users can store their system-wide available applications. Apple's System Applications will be in another location.
Finder transparently shows them just as 'Applications'. However, Developers might need to get the correct native path.
This example shows how to find Applications by BundleID (the preferred way), by AppName (this will try to find it in all possible system defined application directories), and it allows to get an Array of Folders defined by Apple (see the Enumeration: NSSearchPathDirectory.
Xojo only provides a single folder using
SpecialFolder.Applications. This example will get all ones (also the per-user Application Folder, if it exists) from the OS.
The example 'Applications' will ask you to select a Document. It then locates all suitable Applications, depending on the LSRolesMask(s) you specify. Or locate Applications that can deal with any given URL (e.g. list all WebBrowsers).
How to use with your Xojo-built .app?
1. Copy the Module 'modMacOSAppsDirectories' from the example, and paste it into your project.
2. Study the example project to learn how to use the provided methods in the Module.
back to overview
contact: Juerg Otter