Category filter
Script to fetch the applications running in the foreground on Mac
Users may have to run several applications on their Macs simultaneously to perform various functions and activities. However, there are chances that they may misuse their corporate devices and run certain applications that could be harmful.
This document guides you on how to fetch the list of applications running in the foreground on a Mac. Hexnode’s Custom Script feature streamlines the process of running scripts on your devices directly from the Hexnode UEM console.
Fetching the list of applications
You can fetch the list of all the applications running in the foreground on your Mac by running the script given below:
1 2 3 4 |
#!/bin/bash tell application “Finder” get the name of every process whose visible is true end tell |
Upon executing the script, all the applications running in the foreground on your Mac will be displayed on the portal.