I saw that there is a clipboard internal command, how do I do it in JSCRIPT? I'm creating a button that takes the selected file or folder and creates Markdown for it.
Note that the generated example says "Some essentials (see Scripting Reference in the manual for the rest)" It doesn't provide a URL and I can't find that in the manual.
I'm still hoping there is a function somewhere I can use and a pointer to the script doco, but I managed to get something working well enough for now. Next Ill' try to work out how to associate it to all files/folders context menu (may need more escaping for some files as I'm not that familiar with markdown either):
run this in the tools/Opus CLI/Ad-Hoc Script Editor
function GetScriptEngineInfo()
{
var s= "";
s += ScriptEngine() + " Version ";
s += ScriptEngineMajorVersion() + ".";
s += ScriptEngineMinorVersion() + ".";
s += ScriptEngineBuildVersion();
return(s);
}
DOpus.Output(GetScriptEngineInfo());
on windows 11 24H2 you should get JScript Version 11.0.16384 which is a 2024 update to the JScript engine compliant with ECMAScript 2024, otherwise it will be JScript Version 5.something which is a 2009 version.
I think we use this as first line to use the older version
As much as I'd like this to be true, it is not. JScript v11 is still roughly Javascript 3. Have you tried to use syntax like let a=1 or const c=2? You'll get an immediate syntax error.
There are few other threads with discussions and requests about newer JScript versions.
// !JSCRIPTVER=3
What this really does is turning on a few backports of a handful functions like .trim() which can be easily implemented via polyfills anyway.