3

currently I want to write a script for AE, which relieves me of some keyboard inputs. Once the script is running, I want to click with the mouse, and then some key-inputs for example X Y and Z should be simulated. The little GUI and the eventhandler are no problems, but the simulation of key pressing. Please help.

var win = new Window ("dialog", "Dummy");
win.aButton = win.add ("button", undefined, "Start");
win.bButton = win.add ("button", undefined, "Stop");

//Start
win.aButton.onClick = function (event){
var activeViewer = app.activeViewer;
    if activeViewer.type == ViewerType.VIEWER_COMPOSITION){

     HERE SHOULD THE KEYS x, y AND z PRESSED VIA THE SCRIPT 

    }else return;
}
//Stop
win.bButton.onClick = function (event){
    win.close();
    return;
}
win.show();
alex
  • 2,464
  • 23
  • 32
OldForester
  • 65
  • 2
  • 6
  • There is something in Extendscript that looks like it can execute KeyboardEvents http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/scripting/pdfs/javascript_tools_guide.pdf Look at page 152 `initKeyboardEvent() eventObj.initKeyboardEvent (eventName, bubble, isCancelable, view, keyID, keyLocation, modifiersList)` – fabianmoronzirfas Nov 11 '14 at 09:49
  • Thanks @fabiantheblind that is the trick. Post Your comment to the answers and I will mark this as solved. :) – OldForester Nov 14 '14 at 09:47
  • 1
    btw: I would love to see your solution. I played a bit with it but did only get ESTK to crash. :-) – fabianmoronzirfas Nov 14 '14 at 10:21

1 Answers1

2

There is something in Extendscript that looks like it can execute KeyboardEvents

Javascript Tools Guide Look at page 152

initKeyboardEvent() eventObj.initKeyboardEvent (eventName, bubble, isCancelable, view, keyID, keyLocation, modifiersList)  
fabianmoronzirfas
  • 4,091
  • 4
  • 24
  • 41