Converting AutoHotKey to AppleScript

Hi. I’ve gotten rather used to the macros I’ve made for my PC but have been having quite a time trying to recreate them. AppleScript is so far the closest thing I’ve found to text-input macro/script writing for OSX. I only really have experience with basic scripting programs, such as AutoHotKey and ACTool. Beyond that I am clueless.

Right now I’m trying to find solutions to a number of little problems I haven’t quite figured out (not even sure if they’re possible through AppleScript alone). I’ve tried to find documentation that would lead me in the right direction, but the one I found (O’Reilly: AppleScript in a Nutshell) refers to Perl and other more in-depth programing languages, leaving me in the dark.

I’ll just throw out 3 of the things holding me up the most, and see where it goes from there :slight_smile: If you want to refer me to some more plain-english resources, I’d appreciate it! If these can’t be done through AppleScript, let me know that too :slight_smile:

Hotkeys. I don’t know the proper term (which is probably why I haven’t found it on my own) but basically I want to be able to press, say “Ctrl-Shift-A” and have the script execute one element of the script, and later press “Ctrl-Shift-S” and execute another part (though repeatedly, and not necessarily in that order). So far the only thing I can think of is an ‘idle’ process that has it look for certain keys, but I have no idea how to write that out.

Input Dialog. Is there a way to have a popup appear and ask for an input (i.e. a variable used later within the script)? So far all the dialog windows I’ve been able to make are simply output-oriented.

Keypresses. Now, I know about the keystroke feature of AppleScript, but is there a way to simulate ‘holding down’ a key, then after a delay, lifting the key? This would basically be used to move a character in a game a certain distance.