mobileconfigを開く
#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
###起動
tell application id "com.apple.systempreferences"
launch
end tell
##############################
#####ダイアログを前面に出す
##############################
tell current application
set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
tell application "Finder"
activate
end tell
else
tell current application
activate
end tell
end if
##############################
#####ダイアログ
##############################
tell application "Finder"
set aliasDesktopPath to path to desktop folder from user domain as alias
end tell
set aliasFilePath to (choose file with prompt "mobileconfigを選んでください" default location (aliasDesktopPath) of type {"com.apple.mobileconfig"} with invisibles and showing package contents without multiple selections allowed) as alias
set strFilePath to POSIX path of aliasFilePath
###起動待ち
tell application id "com.apple.systempreferences"
###起動確認 最大10秒
repeat 10 times
activate
set boolFrontMost to frontmost as boolean
if boolFrontMost is true then
exit repeat
else
delay 1
end if
end repeat
end tell
set strPaneId to "com.apple.Profiles-Settings.extension" as text
set strAnchorName to "Main" as text
###アンカーで開く
tell application id "com.apple.systempreferences"
launch
activate
reveal anchor strAnchorName of pane id strPaneId
end tell
###アンカーで開くの待ち 最大10秒
repeat 10 times
tell application id "com.apple.systempreferences"
tell pane id strPaneId
set listAnchorName to name of anchors
end tell
if listAnchorName is missing value then
delay 1
else if listAnchorName is {"Main"} then
exit repeat
end if
end tell
end repeat
tell application "Finder"
set theCmdCom to ("open \"" & strFilePath & "\" | open \"x-apple.systempreferences:com.apple.preferences.configurationprofiles\"") as text
do shell script theCmdCom
end tell
| 固定リンク
「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)