I have another small question. Here is my script
include("../MyScripts.js");
function ExSkelton(guiAction) {
MyScripts.call(this, guiAction);
};
ExSkelton.prototype = new MyScripts();
ExSkelton.prototype.beginEvent = function() {
MyScripts.prototype.beginEvent.call(this);
var _f = RGuiAction.getByScriptFile("scripts/File/NewFile/NewFile.js");
if (!isNull(_f)) { _f.slotTrigger(); }
this.terminate();
};
ExSkelton.init = function(basePath) {
var action = new RGuiAction(qsTr("&Skelton"), RMainWindowQt.getMainWindow());
action.setRequiresDocument(true);
action.setScriptFile(basePath + "/ExSkelton.js");
action.setGroupSortOrder(50100);
action.setSortOrder(100);
action.setWidgetNames(["MyScriptsMenu"]);
};
The code works OK, I get a new file created. This is good.
But I would like to set
Code: Select all
(line 20) action.setRequiresDocument(false);
When doing this, my code works as well, but I get some warnings on the terminal:
Qcad 3.12.6
Code: Select all
Warning: RScriptHandlerEcma::eval: script engine exception: "TypeError: Result of expression 'a.finishEvent' [undefined] is not a function."
Qcad 3.14.2
Code: Select all
Warning: RScriptHandlerEcma::eval: script engine exception: "TypeError: Result of expression 'a.destroy' [undefined] is not a function."
Is it all that important?
I only tested my script on Linux so far, but at work, I have Qcad Pro on Windows 10 OS. Will my script work on Windows as well?
Thanks for replying