トラックパッドのシステム環境設定をUIアップルスクリプトで操作設定する

2018年11月24日(土)

「お好みトラックパッド設定.scpt」

ダウンロード「お好みトラックパッド設定.scpt」(8KB)track_pad.zip(macOS 10.14 Mojave(モハベ)用)

メモ
「スクリプトエディタ」か「スクリプトメニュー」で実行してください。

このスクリプトの内容は、私の好みに合わせた設定をシステム環境設定で設定していくサンプルスクリプトです。カスタマイズしてご利用ください。



戻る(UIスクリプトの階層を探る)

トップページ








このスクリプトの内容

tell application "System Preferences" to activate
tell application "System Events"
repeat until exists menu item "トラックパッド" of menu "表示" of menu bar item "表示" of menu bar 1 of application process "System Preferences"
delay 1
end repeat
click menu item "トラックパッド" of menu "表示" of menu bar item "表示" of menu bar 1 of application process "System Preferences"
delay 1
click radio button "ポイントとクリック" of tab group 1 of window "トラックパッド" of application process "System Preferences"
set item_ to checkbox 1 of tab group 1 of window "トラックパッド" of application process "System Preferences" --調べる&データ検出
if value of item_ is 0 then click item_
set item_ to checkbox 2 of tab group 1 of window "トラックパッド" of application process "System Preferences" --服ボタンのクリック
if value of item_ is 0 then click item_
set item_ to checkbox 3 of tab group 1 of window "トラックパッド" of application process "System Preferences" --タップでクリック
if value of item_ is not 1 then click item_
set value of slider "クリック" of tab group 1 of window "トラックパッド" of application process "System Preferences" to 1
set value of slider "軌跡の速さ" of tab group 1 of window "トラックパッド" of application process "System Preferences" to 9 --速さ1〜9
set item_ to checkbox 4 of tab group 1 of window "トラックパッド" of application process "System Preferences" --強めのクリックと触覚フィードバック
if value of item_ is 0 then click item_
set item_ to checkbox 5 of tab group 1 of window "トラックパッド" of application process "System Preferences" --強めのクリックと触覚フィードバック
if value of item_ is 1 then click item_ --サイレントクリック
click menu item "アクセシビリティ" of menu "表示" of menu bar item "表示" of menu bar 1 of application process "System Preferences"
repeat until exists window "アクセシビリティ" of application process "System Preferences"
delay 1
end repeat
select row 17 of table 1 of scroll area 1 of window "アクセシビリティ" of application process "System Preferences" -- "マウスとトラックパッド"
repeat 7 times
delay 1
if exists button "トラックパッドオプション…" of group 1 of window "アクセシビリティ" of application process "System Preferences" then exit repeat
end repeat
click button "トラックパッドオプション…" of group 1 of window "アクセシビリティ" of application process "System Preferences"
repeat 7 times
delay 1
if exists sheet 1 of window "アクセシビリティ" of application process "System Preferences" then exit repeat
end repeat
set value of slider "スクロールの速さ:" of sheet 1 of window "アクセシビリティ" of application process "System Preferences" to 3 --速さ0〜7
set item_ to checkbox "スクロール" of sheet 1 of window "アクセシビリティ" of application process "System Preferences"
if value of item_ is 0 then click item_
set item_ to pop up button "スクロール" of sheet 1 of window "アクセシビリティ" of application process "System Preferences"
click item_
delay 1
click menu item "慣性スクロールあり" of menu 1 of item_
set item_ to checkbox "ドラッグを有効にする" of sheet 1 of window "アクセシビリティ" of application process "System Preferences"
if value of item_ is 0 then click item_
set item_ to checkbox "ドラッグを有効にする" of sheet 1 of window "アクセシビリティ" of application process "System Preferences"
if value of item_ is 0 then click item_
set item_ to pop up button "ドラッグを有効にする" of sheet 1 of window "アクセシビリティ" of application process "System Preferences"
click item_
delay 1
click menu item "ドラッグロックあり" of menu 1 of item_
click button "OK" of sheet 1 of window "アクセシビリティ" of application process "System Preferences"
end tell