Edited at

カーソルサイズをトグルするAppleScript

More than 3 years have passed since last update.

動作するけど汚い…

tell application "System Preferences"

set current pane to pane "com.apple.preference.universalaccess"

tell application "System Events"
repeat until application process "System Preferences" is not (exists)
end repeat
delay 0.5
tell first window of process "System Preferences"
tell table 1 of scroll area 1
set selected of row 2 to true
end tell
repeat until slider "カーソルのサイズ:" exists
end repeat

set theSlider to slider "カーソルのサイズ:"
set stash to value of theSlider
if value of theSlider is 1.0 then
set value of theSlider to 4
else
set value of theSlider to 1.0
end if
stash
end tell
end tell
quit
end tell


20160716時点でうまく動かない…repeat入っているので使用には注意。

カーソルサイズを最小=最大でトグル。

Maestroなどでショートカットキーを当てて使用

tell application "System Preferences"   

set current pane to pane "com.apple.preference.universalaccess"
end tell
tell application "System Events"
tell first window of process "System Preferences"
repeat until slider "カーソルのサイズ:" exists
end repeat
tell table 1 of scroll area 1
set selected of row 2 to true
end tell
set theSlider to slider "カーソルのサイズ:"
set stash to value of theSlider
if value of theSlider is 1.0 then
set value of theSlider to 4
else
set value of theSlider to 1.0
end if
stash
end tell
end tell
tell application "System Preferences" to quit


問題点

アクセシビリティパネルで「キャプション」を選択している(していた)と、ディスプレイへ自動で移動できない。


コードをお借りした&参考にしたページ

『画面のグレー/カラーのスイッチ』

http://goozenlab.com/blog/2013/02/grayscale-switch/

『mouse - How can I easily toggle the cursor size back and forth between normal and largest? - Ask Different』

http://apple.stackexchange.com/questions/88267/how-can-i-easily-toggle-the-cursor-size-back-and-forth-between-normal-and-larges