スティッキーキーがオンになっている場合にのみ、スクリプトが5キー(マウスの左クリックをトリガーする)をスパムできるように、Applescriptを介してマウスキーの状態を確認できるようにしたいと思います。これにより、ショートカットを使用してスティッキーキーをオフにする(optionキーを5回押す)スクリプトをオフにすることができます。
これまでの私のコード:
on idle
tell application "System Preferences"
activate
set current pane to pane id "com.apple.preference.universalaccess"
end tell
tell application "System Events"
tell process "System Preferences"
click menu item 6 of menu 1 --pseudocode
if value of checkbox "Enable Mouse Keys" is 1 then
key code 87 --press the "5" key, triggers mouse press
end if
end tell
end tell
set rn to (random number from 0.8 to 1.0) as text
return rn
end idle
私の問題はclick menu item 6 of menu 1
、アクセシビリティペインの「マウスとキーボード」セクションにアクセスするための回線と方法にあります。それがまだ明らかでない場合、私はapplescriptの経験がほとんどありません。> _>