|
Hello,
Apologies for the ambiguous title. I’m trying to set the siUIKeywordFile attribute for a text editor widget. The following works fine:
var JScriptKeywordPath = "C:\\syntaxHighlight\\jscript.keywords";
However what I want is to set a relative path. edit: (or get the full path of the file executing the code)
I have a couple of ideas in my head but ‘Googling’ hasn’t helped much:
1. Is there a way to get the path of the current file? Since everything is under an Addon folder, I can just build the path if I can get the path of my current js file. I know about [B]Scripting.fileSystemObject[/B] and the [B]getFile(ref)[/B]/[B]getAbsolutePathName(ref)[/B] method but I can’t figure out how to set [B]ref[/B] to the file itself (without using an absolute path)
2. I tried using [B]Application.InstallationPath(siWorkgroupAddonPath)[/B] but that returns the path to the top-most workgroup. I can’t expect people to put my addon right at the top.
3. The SDK desn’t specify whether an absolute path is required for siUIKeywordFile. If not, the easiest way would, of course, be to have the ability to use relative paths. I tried ..\\syntaxHig… it doesn’t work, tried many other combination but none of them worked. Which leads me to believe that relative paths are not supported.
Any help appreciated :)
Cheers,
|