[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
##UTIでOPENする方法
tell application "Finder"
set theCmdCom to (" open \"x-apple.systempreferences:com.apple.preferences.configurationprofiles\"") as text
do shell script theCmdCom
end tell
##ExtensionKitのUTIでOPENする方法
tell application "Finder"
set theCmdCom to (" open \"x-apple.systempreferences:com.apple.Profiles-Settings.extension\"") as text
do shell script theCmdCom
end tell
###NSURLにしてUTIをsharedWorkspace経由で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」カテゴリの記事
- 【メモ】MDMでイマイチまだ理解が足りない部分(2025.01.11)
- [mobileconfig]言語設定の変更(非推奨)(2024.12.20)
- mobileconfigを使って言語設定を切り替える(2024.12.16)
- [The Unarchiver] mobileconfigの値を見直した(2024.12.06)
- [NSGlobalDomain_m]AppleLanguages(2024.11.27)
「Admin Device Management」カテゴリの記事
- デバイスUUIDの取得(2024.11.11)
- モデル名を取得する(2024.05.17)
- TB Default Item Identifiers(com.apple.finder.plist)(2023.12.22)
- [profiles] profiles コマンド書き出したバックアップを各ファイルに書き出す(2023.11.12)
- [profiles]現在のユーザー・プロファイル設定をバックアップ(2023.10.31)
「System Settings」カテゴリの記事
- [System Settings]システム設定収集v7(ユーザーインストールのパネルの取得に対応した)(2025.01.18)
- [System Settings]システム設定収集v6(表示言語英語でも収集できるようにした)(2025.01.18)
- EnableTilingByEdgeDrag to false (disable TilingByEdgeDrag)ウィンドウを画面端にドラッグすると実行されるタイル表示を無効化(2024.09.18)
- システム設定をオープンさせるスクリプトの作成補助v5 (macOS14.5でreveal anchorの位置がずれるのに対応)(2024.05.28)
- [システム設定] reveal anchorで開くと位置がずれる(macOS14.5)(2024.05.28)