« [システム設定]外観 com.apple.preference.general(macOS13) | トップページ | [システム設定]一般 com.apple.preference.general(macOS13) »

[com.apple.Profiles-Settings.extension]システム設定(プロファイル)を開く


#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#error number -128
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions


property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL


tell application "System Settings" to launch

--システム環境設定が開くのを待つ
repeat
set doLaunchApp to get running of application "System Settings"
if doLaunchApp is false then
delay 0.5
else
exit repeat
end if
end repeat


###パネルをOpenする方法
set strCommandText to "open -b com.apple.systempreferences \"/System/Library/PreferencePanes/Profiles.prefPane\"" as text
do shell script strCommandText
delay 5

##UTIOPENする方法
tell application "Finder"
set theCmdCom to (" open \"x-apple.systempreferences:com.apple.preferences.configurationprofiles\"") as text
do shell script theCmdCom
end tell

##ExtensionKitUTIOPENする方法
tell application "Finder"
set theCmdCom to (" open \"x-apple.systempreferences:com.apple.Profiles-Settings.extension\"") as text
do shell script theCmdCom
end tell


###NSURLにしてUTIsharedWorkspace経由でOPENする方法
###OS13の場合はこの方法が推奨か?
set ocidWorkspace to refMe's NSWorkspace's sharedWorkspace()
####これでも開けるが
set ocidSystemPreferencesURL to refNSURL's URLWithString:"x-apple.systempreferences:com.apple.preferences.configurationprofiles"
#### OS13からは Settings.extensionで開くのが作法
set ocidSystemPreferencesURL to refNSURL's URLWithString:"x-apple.systempreferences:com.apple.Profiles-Settings.extension"

ocidWorkspace's openURL:ocidSystemPreferencesURL

|

« [システム設定]外観 com.apple.preference.general(macOS13) | トップページ | [システム設定]一般 com.apple.preference.general(macOS13) »

Admin Mobileconfig」カテゴリの記事

Admin Device Management」カテゴリの記事

System Settings」カテゴリの記事