Created
January 31, 2025 06:11
-
-
Save donaldguy/950b178ab9d0f20184b4a06a0d6c72a4 to your computer and use it in GitHub Desktop.
JXA sh template and group name fetch - I ended up throwing these away (and just globbing-ish in ~/Library/Group Containers)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let sh = (strs, ...subs) => { | |
const q = (s) => `${s}`.match(/^['"].*['"]$/) ? `${s}` : `'${s}'` | |
return app.doShellScript( | |
strs.flatMap((s,i) => subs[i] ? [s.trim(), q(subs[i])] : s.trim() ).join(" ") | |
) | |
} | |
let getAppGroup = (appName) => sh`codesign --display --entitlements - --xml 2> /dev/null | |
${Application("System Events").applicationProcesses[appName].applicationFile().posixPath()} | |
| plutil -extract 'com\\.apple\\.security\\.application-groups.0' raw -` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment