Page 1 of 1

List of Scripting Commands and Vars for Syntax Highlighting

Posted: 03 Apr 2014 04:27
by FluxTorpedoe
Hi'

• Att: Scripters who create syntax highlighting files for editors (Notepad++, PSPad, etc.).
• Obj: Scripts to export a "clean list" of Scripting Commands, and of Variables, so it's easy to spot the changes between XYplorer versions (e.g. export list from XY v13.90, then compare with one exported from XY v11.00).
Export Scripting Commands.png
Export Scripting Commands.png (136.11 KiB) Viewed 3123 times
:arrow: Scripting Commands:
Add this to a UDC "User | Manage Commands | Run Script".
Caption: Export XY Scripting Commands.
Script:

Code: Select all

// backupto and copyto only appear on moveto line
// moveas only appears on copyas line

  msg "<crlf>Help window will now open.<crlf>Click on window to focus it, select all and copy.  <crlf>You can close Help window when you're done copying.";
  rtfm "idh_scripting_comref.htm";
  if (<clipboard> && confirm("Click OK when you're done copying.")) {
    writefile("XY_ScriptingCommands.txt", regexreplace(regexmatches(regexreplace(<clipboard>, "\r\n\r\n(?=\w)", <crlf>), "([^\n]+ *\r\n[^\n]+ *\r\n)Syntax *\r\n([^\n]+ *\r\n)", <crlf>), "Syntax *\r\n"));
  }
:arrow: Variables:
Add this to a UDC "User | Manage Commands | Run Script".
Caption: Export XY Scripting Variables.
Script:

Code: Select all

  msg "<crlf>Help window will now open.<crlf>Click on window to focus it, select all and copy.  <crlf>You can then close Help window.  <crlf>You have 7 seconds before the data is processed and saved.";
  rtfm "idh_variables.htm";
  wait 7000;
  writefile("XY_ScriptingVariables.txt", regexreplace(<clipboard>, "(^[^<%\r\n ][^\r]*|^ (?! *[<%\r])[^\r]*|^ *)(\r\n)*"));
Alternately, you can manually copy the help page of Commands or Variables, and then only run the "writefile(..." lines.

It was a huge time saver for me when updating my Akelpad definitions after several months.
I hope this will be useful to those who make syntax highlighting definitions for other editors!

Have a nice day, 8)
Flux

Re: List of Scripting Commands and Vars for Syntax Highlight

Posted: 09 Sep 2016 10:46
by FluxTorpedoe
Slight update: For Scripting Commands, replaced the delay before processing with a confirmation dialog (depending on the system, 15 sec wasn’t enough).

Re: List of Scripting Commands and Vars for Syntax Highlight

Posted: 09 Sep 2016 11:02
by highend
Great idea, Flux!

May I suggest that you use hh.exe (comes with Windows at least since XP) to decompile the .chm and let the script do everything instead of doing those things manually?

I use the same method for my ShowHelpTopic script so that everything runs without user intervention

Don't forget to add templates for all major editors :mrgreen:

Re: List of Scripting Commands and Vars for Syntax Highlight

Posted: 09 Sep 2016 14:25
by FluxTorpedoe
highend wrote:Don't forget to add templates for all major editors
Well, as soon as I get the clearance for my “30 hours per day” application form, I’m on it! 8)
highend wrote:May I suggest that you use hh.exe […] to decompile the .chm
Didn’t know about this one, interesting!
Although my needs aren’t recurrent enough yet to justify coding-batching this syntax thingy, I’ll keep an eye on it for other potential needs…

Re: List of Scripting Commands and Vars for Syntax Highlight

Posted: 09 Sep 2016 14:29
by highend
as soon as I get the clearance for my “30 hours per day” application form
Granted, go for it! :shock: