Skip to content

Commit

Permalink
updated 'isManaged' functions to use NSUserDefaults also
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptingosx committed Nov 9, 2021
1 parent bd7bd57 commit 8ff45bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Fragments/Header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ EndOfScript
function getPrefIsManaged() { # $1: domain, $2: key
osascript -l JavaScript << EndOfScript
ObjC.import('Foundation')
$.CFPreferencesAppValueIsForced(ObjC.wrap('$1'), ObjC.wrap('$2'))
ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('$1').objectIsForcedForKey('$2'))
EndOfScript
}

function getPrefIsManagedrunAsUser() { # $1: domain, $2: key
runAsUser osascript -l JavaScript << EndOfScript
ObjC.import('Foundation')
$.CFPreferencesAppValueIsForced(ObjC.wrap('$1'), ObjC.wrap('$2'))
ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('$1').objectIsForcedForKey('$2'))
EndOfScript
}

Expand Down

0 comments on commit 8ff45bf

Please sign in to comment.