Script to open apps on Mac
To open an application on their system, users will have to find the app and double click on the app icon. With shell scripts, you need not know or navigate to the location of the app on the system, you can simply specify the app name or identifier to open the app. Moreover, you can open multiple apps from a single line command. This method is not only quick but also an effective way to remotely launch applications on a Mac.
Device admins can remotely run scripts on Macs managed with Hexnode using the Execute Custom Script action.
Scripting language – Bash
File extension – .sh
Open an app
open -a "App name"
open command can be used to open a file, directory, or URL. Some of the options supported with the open command in this respect are –
- It specifies the name of the application to open. For example,
open -a “App Store”
- It specifies the bundle identifier of the application to open. For example,
open -b com.apple.AppStore
- It opens the application in the background. For example,
open -g -a “App Store”
- It opens a new instance of the application if it is already running. For example,
open -n -a “App Store”
- It launches the app hidden. For example,
open -j -a “App Store”