How to get Applescript to trigger rapid fire keystrokes?

Hello all! Just made the switch from PC to Mac and loving it so far but there is one last key thing I need to get my set-up to be back to "normal". I have seen a few threads with the same question but the responses are quite frankly lacking in specifics and don't really resolve the issue (recommending apps that might solve the problem but provide no specifics as to how the script might be written in said program).

Here is the request:
I play games (notably World of Warcraft) where I have the need to have a key (1-6 number keys) repeat their signal (every 10th of a sec) when the key is pressed down, and stop when key is released. Additionally, I would like to have a toggle key (the \ key for example) that will toggle this functionality on an off while in the game (this way I can type prose without unintentionally spamming 11111 when I only want to press 1 once).

The reason why:
Games like World of Warcraft require crazy amounts of fast repetitive keystrokes. My wrists are not as young as they used to be and I am starting to feel the burn from just limited amounts of play. Allowing me to press and hold a key as opposed to spamming it as fast as humanly possible would help a LOT. Some PC users are familiar with AutoHotkey which can easily do what I am asking. I just need to believe that Applescript can do the same.

Are there any good scripters that can provide assistance?

27" i7 iMac, Mac OS X (10.6.4)

Posted on Sep 5, 2010 12:22 PM

Reply
4 replies

Sep 6, 2010 12:07 AM in response to taylor.henderson

Not much of a programmer but I did find this example of someone trying to do the same thing as me... The issue is I think its a bit dated since the KeyboardViewer no longer seems to be included in Mac OS 10.6

The example was:


on idle
tell application "System Events"
tell application "KeyboardViewerServer" to activate
set CAPS to (get value of checkbox "⇪" of window 1 of application process "KeyboardViewerServer") as number
if CAPS is 1 then
tell application "World of Warcraft" to activate
repeat until CAPS is 0
set CAPS to (get value of checkbox "⇪" of window 1 of application process "KeyboardViewerServer") as number
keystroke "1"
end repeat
end if
return 1
end tell
end idle



Anyone got an idea on how to make this work in the current MacOS?

Sep 6, 2010 11:41 PM in response to Tony T1

Thanks for the tip... I was able to download a copy of ControllerMate and though it took me a while to figure it out, I was able to do exactly what I wanted to. I can now have a key be a rapid fire button, only work inside a specific app, and have a toggle key to turn on and off the effect while ingame. My burning wrists and I thank you again.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to get Applescript to trigger rapid fire keystrokes?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.