Post
by marksmithhfx » Tue Dec 20, 2022 8:53 pm
richmond62 wrote: ↑Tue Jul 05, 2022 1:01 pm
I thought I would be clever and try this:
Code: Select all
on mouseUp
if (shell("top -o rsize -ncols 2 -l 1")) contains "safari" then
put "Yes"
else
put "No"
end if
end mouseUp
Well, this worked great outside the Mac App Store but building for the store requires sandboxing and a sandboxed app that runs that shell command returns the following error message:
Code: Select all
/bin/sh: line 1: /usr/bin/top: Operation not permitted
Lovely. I'm now on the hunt to see if a sandboxed app can determine if a specific app is running on the users machine. If anyone has any experience in that regard, or has an entitlement to suggest I try, I would be delighted!!
Thanks
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS