List of Scripting Commands and Vars for Syntax Highlighting

Discuss and share scripts and script files...
Post Reply
FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

List of Scripting Commands and Vars for Syntax Highlighting

Post 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 3119 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
Last edited by FluxTorpedoe on 09 Sep 2016 11:14, edited 2 times in total.

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: List of Scripting Commands and Vars for Syntax Highlight

Post 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).

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: List of Scripting Commands and Vars for Syntax Highlight

Post 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:
One of my scripts helped you out? Please donate via Paypal

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: List of Scripting Commands and Vars for Syntax Highlight

Post 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…

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: List of Scripting Commands and Vars for Syntax Highlight

Post by highend »

as soon as I get the clearance for my “30 hours per day” application form
Granted, go for it! :shock:
One of my scripts helped you out? Please donate via Paypal

Post Reply