This post goes over different options of sending keystrokes via scripting and how to store data in variables to be used in your script.
This post goes over different options of sending keystrokes via scripting and how to store data in variables to be used in your script.