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 –
-a– specifies the name of the application to open.
open –a “App Store”
-b– specifies the bundle identifier of the application to open.
open –b com.apple.AppStore
-g– opens the application in the background.
open –g –a “App Store”
-n– opens a new instance of the application if it is already running.
open –n –a “App Store”