Skip to content

Instantly share code, notes, and snippets.

@donaldguy
Created January 31, 2025 06:11
Show Gist options
  • Save donaldguy/950b178ab9d0f20184b4a06a0d6c72a4 to your computer and use it in GitHub Desktop.
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)
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