作者dt9150813 (一滴滴歪)
看板MAC
標題[求救] 請問怎麼在applescript裡面使用按鍵偵測
時間Tue Oct 1 02:07:14 2013
各位大大好,我想用applescript寫出類似autohotkey的功能(要拿來玩暗黑三冰法)
只是上網搜尋不到如何在if後面添加按鍵觸發
這是目前我寫出來測試的:
tell application "TextEdit"
activate
end tell
tell application "System Events"
repeat while 4 is 4
tell process "TextEdit"
set frontmost to true
end tell
keystroke "w"
delay 0.01
keystroke "e"
delay 0.01
keystroke "r"
delay 0.3
end repeat
end tell
然後我想要達到當按下空白鍵時,電腦自動重複按WER
請問要怎麼寫或是用什麼軟體可以達成呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.240.127.254
→ pneumonoultr:可以試試fastscript 不保證可以就是了 10/01 08:23
→ dt9150813:感謝大大回應! 那請問可以用if (keys pressed) contains 10/01 12:16
→ dt9150813:來寫嗎? 10/01 12:16
→ pneumonoultr:fastscript是給你的script設定hotkey 10/01 20:17
→ pneumonoultr:所以就寫個script是重覆wer 然後這個script的hotkey 10/01 20:18
→ pneumonoultr:是空白鍵就好了 10/01 20:19
→ dt9150813:謝謝!馬上去試試看! 10/01 23:14