Hi Quaritexa,
> I want to describe several functions to call it from shortcuts inline scripts like that:
> code:
>
> script:#include "moi://scripts/test.js"; testfunc("display text");
#include is not supported in direct inline script code like you have there.
It is supported when the script is loaded from a .js file.
So like I described above, you will need to put your script code into 2 different .js files, one for your script and one for the library and place those files in a "scripts" directory that you will make in the install folder as a sibling to "commands".
So for example, create a file named test.js , which contains this content:
code:
#include "test_lib.js"
testfunc( 'display this' );
Then create a second file named test_lib.js also located in the "scripts" directory. Put this inside of it:
code:
function testfunc( val )
{
moi.ui.alert( val );
}
Now for your shortcut key put in "test .js" note the .js file extension is included here.
Then when the shortcut key is executed, it will load the content of the test.js file and process the includes (includes must be at the top of the file) and then run it as immediate executed script the same as how inline script code is run.
- Michael
|