gpt4 book ai didi

javascript - 如何在 ExtendScript 中模拟按键?

转载 作者:行者123 更新时间:2023-11-29 21:55:07 26 4
gpt4 key购买 nike

目前我想为 AE 编写一个脚本,这可以减轻我一些键盘输入的负担。脚本运行后,我想用鼠标单击,然后模拟一些键盘输入,例如 X Y 和 Z。小GUI和eventhandler没问题,就是模拟按键。请帮忙。

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();

最佳答案

Extendscript里面有个东西貌似可以执行KeyboardEvents

Javascript Tools Guide看第152页

initKeyboardEvent() eventObj.initKeyboardEvent (eventName, bubble, isCancelable, view, keyID, keyLocation, modifiersList)  

关于javascript - 如何在 ExtendScript 中模拟按键?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26850666/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com