XAppProcess allows you to send key events to the application process specified with a bundle identifier.
“keystroke” and “key code” commands of “System Events” can send key events only to the frontmost application process. But XAppProcess can send key events to any background processes.
Also following oprerations to application processes are provided:
The manual consisted of the reference generated by AppleScriptDoc and sample code is stored in the bundle of "XAppProcess.scptd". Run "XAppProcess" from Script menu.
The detail manual of "XAppProcess" should be displayed in Help Viewer.
Copy XAppProcess.scptd into either following locations.
Your Home/Library/Script Libraries/
or
/Library/Script Libraries/