Hi,
I found no way to include an external script into my scripts.
So I ended with this workaround.
Note: This is just a proof of concept. It worked fine for me but it is not really tested.
For testing I used the "FileNameFunctions.js" from here http://www.ultraedit.com/forums/viewtop ... =52&t=6762 (without the examples at the bottom of file).
1. Add this in the first line of your script with the full path of the external file
2. Add this function to the script that want to include the external file
With this I was able to use all the functions defined in "FileNameFunctions.js" in my script.
Is there really no better way to include externals scripts?
Nicolai
I found no way to include an external script into my scripts.
So I ended with this workaround.
Note: This is just a proof of concept. It worked fine for me but it is not really tested.
For testing I used the "FileNameFunctions.js" from here http://www.ultraedit.com/forums/viewtop ... =52&t=6762 (without the examples at the bottom of file).
1. Add this in the first line of your script with the full path of the external file
Code: Select all
eval(include("D:\\Downloads\\FileNameFunctions.js"));
Code: Select all
function include(file)
{
var doc = UltraEdit.activeDocument.path;
UltraEdit.open(file);
UltraEdit.activeDocument.selectAll();
var inc = UltraEdit.activeDocument.selection;
UltraEdit.closeFile(file,2);
for (index = 0; index < UltraEdit.document.length; index++) {
if (UltraEdit.document[index].path == doc)
{
UltraEdit.activeDocument =UltraEdit.document[index];
}
}
return inc;
}
Is there really no better way to include externals scripts?
Nicolai