Keystroke emulation options OSX

Wondering if there are any alternatives to creating keystroke simulations in OSX.
I have tried to simulate the “return”, “option”, and letter “i” keystrokes using AppleScript but the result is not predictable.

What other options exist to simulate keystrokes?