« [Tools]スクリプトメニュー用カラー関連 | トップページ | [システム設定]プライバシーとセキュリティ com.apple.preference.security(macOS13) »

[COLOR]カラー関連(スクリプトメニュー用)

#!/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

set listAppName to {"ColorSyncユーティリティ", "Digital Color Meter", "ディスプレイキャリブレータ", "ディスプレイ設定"} as list
try
set objResponse to (choose from list listAppName with title "選んでください" with prompt "選んでください" default items (item 1 of listAppName) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed)
on error
log "エラーしました"
return
end try
if objResponse is false then
return
end if
set theResponse to (objResponse) as text
log theResponse
set numCntLength to 1 as number
repeat with itemAppName in listAppName
log itemAppName
if (itemAppName as text) is theResponse then
set numListCnt to numCntLength
end if
set numCntLength to numCntLength + 1 as number
end repeat
log numListCnt

set listUTI to {"com.apple.ColorSyncUtility", "com.apple.DigitalColorMeter", "com.apple.ColorSyncCalibrator", "com.apple.preference.displays"} as list

if numListCnt3 then
####アプリを開く
set strUTI to item numListCnt of listUTI
tell (application id strUTI) to launch

else if numListCnt = 4 then
###システム設定(ディスプレイ)を開く
set strCommandText to "open -b com.apple.systempreferences \"/System/Library/PreferencePanes/Displays.prefPane\"" as text
do shell script strCommandText

end if

|

« [Tools]スクリプトメニュー用カラー関連 | トップページ | [システム設定]プライバシーとセキュリティ com.apple.preference.security(macOS13) »

AppleScript Color」カテゴリの記事