我正在尝试编写一个宏,该宏会自动将选定的文本更改为小写。我通常只需使用键盘并快速按 alt+e、t、enter,这对我来说就像一个宏一样好,但我正在尝试为我的同事导出一组有用的宏。
到目前为止我已经
%SCRIPT
var menu = app.getManagedMenu("main/edit"); //define "menu" as the edit menu
var enter = app.simulateKeyPress("Enter") //define "enter" as pressing the enter key
var act = app.newManagedAction(menu, "T", enter); //define act as opening the edit menu, pressing T to open Text Operations, and pressing enter to activate
act(); //acting out above
错误代码为
Uncaught exception at line 3: TypeError: ambiguous call of overloaded function newManagedAction(); candidates were
newManagedAction(QWidget*,QString,QString)
newManagedAction(QWidget*,QString,QAction*)
Backtrace <global>() at 3
有人能帮忙吗?我在这里算是边工作边学习。
我正在 TexStudio 中编写宏