Forgive me if this topic has been discussed before, but I haven't found what I am expecting to see.
We have a couple of scripts that will uninstall applications like MS Office, Adobe CC 2018 and a few more applications. In these scripts, we simply look for occurrences of items in various folders. They run perfectly on the Macs via self service or other policy mechanisms. The problem is, if a user has one of these applications open when the policy is run, it leaves the computer and applications in a very unstable state.
Ideally, this would be run at logout to ensure no one is logged in. For most of our laptop users, this simply won't happen. Desktops, we hit at night when no one is here.
Does anyone have a script or other mechanism they would use to verify whether or not an application is running before the update process is run? We have tried an AppleScript using the system events stuff, but that will only run locally and I can't find a way to run it via a policy or remotely.
Thank you for your replies and insights. Unfortunately, I am not well versed in scripting so this is a little tougher than it probably needs to be.