Hi there,
I'm usually create a button , and then edit it, write some script in the script editor, is there a way to edit the code in VSCode directly rather than in the internal editor?
I'm currently edit code in VSCode, and then copy the code to the button in DOpus, it's not very convinient.
Little question about VSCODE. When I click EDIT in the SCRIPT MANAGER, it opens another DIALOGUE (lets call it RESOURCES) containing the resources for the file I clicked on. It opens in VSCODE perfectly.
My question is about saving. Do I need to constantly SAVE IN VSCODE, then go to the to RESOURCES dialogue and then SAVE THERE ALSO.
Is DOPUS polling the edited file to see if it was saved, automatically saving it ?
No need to go back to Opus editor after editing in a third party editor as long as you keep the RESOURCES section at the end of your file.
EDIT: and yes, saving in external editor reloads the script for Opus to use tha last saved version (syntaxic errors, if any, will appear in the script log)
Not sure what you mean here. I don't have a RESOURCES section. I created everything kind of manually. Can I still add it after the fact, or should I make a brand new script and copy my code over?
I have to manually hit CTRL S or SAVE button in the SCRIPTS/RESOURCES dialogue
If your script contains UI elements (that you probably created with the designer), opening directly the .js or .vb file will get you your code and a resource section at the end.
See the code in the first post here : FAYT script : Dynamic Tab Groups
EDIT: I realize you probably don't have UI elements if you created all by yourself (IMHO using ui components is way easier with the resource designer). In that case : no RESOURCES section in your code and no need to copy back to the Opus editor (the one you call RESOURCES). Saving in VSCODE should be enough. That's what I do with sublime text, there's no reason it would be different with another text editor.
If you open the file directly with your external editor from its location on disk without opening the window from script manager, saving from external editor works.
I agree that dialog editing is way easier from designer.
I use this method only when no dialog creation/updating is necessary.
Once that is done, I can use it again (being careful to preserve the end of script RESOURCES section)
It does for me, and seems to be the case for lxp too : check again the script logs.
One case it won't : syntaxic errors (which would also display in script log), but this should invalidate the whole script as far as I remeber (away from computer, can't test right now)
Now, if you setup the external editor as VSCODE, it should also work if you try and edit from the "Resources window" you get from the script manager.
Do whatever suits you best.
On my side I have set-up a "project" in sublime text that exposes the whole add-ins folder, so it's easier to open directly from sublime text. I only use the window from script manager when I need the designer.
In that case, I have to be carefull to save in sublime text before opening the "resource window" to do dialog design, save there, then in sublime text, revert from disk to load the resources modifications, then keep on modifying there (after closing the "resources window" to avoid conflicts and errors).