Script: Call specific help topics

Discuss and share scripts and script files...
highend
Posts: 13033
Joined: 06 Feb 2011 00:33

Script: Call specific help topics

Post by highend »

Hey,

Edit 2023-02-10:
v1.1.6
Fixed: Since v24.00.0104 'get()' has its own html file

v1.1.5
Fixed: Version comparison

v1.1.4
Changed: Add "Run as user_x64.exe"

v1.1.3
Changed: v23.80.0104 changed the html code slightly so that we need to get
the correct part for the advanced scripting section in a slightly different way

v1.1.2
Changed: Switched to .ini & .cfg from permanent variables
It is possible that the script hangs on the first time when selecting a help file content entry!
No time to debug that atm...
It should work fine on the second and all following attempts.

Edit 11.07.2014:
Because of my personal laziness (I didn't want to include all the latest script commands by hand any more^^)
I rewrote the script... Now it extracts the content of the XYplorer.chm file whenever you update your XY version
and gets all the topics automatically (instead of adding them directly in the script).

This is not a 100% foolproof thing because if the structure of the extracted file changes internally I'd have to reflect
that in the script. Additionally, if the main topic count changes I'll have to adapt the script as well (to add additional
dividers for these sections).


To use the external viewer:
Just copy "ShowHelpFile.exe" and "ShowHelpFile.ini" to the same directory (wherever you like).
By default the script looks in "<xyscripts>" but if it isn't found it'll ask for the correct location.

If you want to define the position and / or size of the .chm window, open the "ShowHelpFile.ini" file and
edit the values for Left=, Top=, Width= and Height=...

[Current version]:
ShowHelpTopic_v1.1.6.zip
(550.78 KiB) Downloaded 72 times
[Old version(s)]:
ShowHelpTopic_v1.1.5.zip
(550.63 KiB) Downloaded 59 times
ShowHelpTopic_v1.1.1.zip
(515.64 KiB) Downloaded 409 times
ShowHelpTopic_v1.1.0.zip
(508.43 KiB) Downloaded 224 times

Description:
I like the keyboard more than a mouse and I have to look up help topics (mainly script commands) quite often.
E.g.: To explore the syntax of a specific script command to use it in the address bar.
Or: Let's see, which inbuild variables XY offers | how ternary conditionals are used, etc.

Opening the help file and clicking through the various entries isn't very "effective", especially the list of script commands
separated by ", " makes it hard to find the one you're looking for.

I've created a script that makes it a bit easier to get what you want.
How I use it:
- Invoke it
- Enter what you're looking for, e.g. "terna" for "ternary conditionals", hit "return"!

-> Help file pops up with the content of Ternary Conditionals.

EDIT: Changed the script slightly. Added configurable dividers to narrow down the list with one entered character.
A few examples:
"@" -> Show only (global) sections (Scripting and Scripting Commands References are excluded)
Atm the "@" is the default for all sections (apart from the two mentioned above + Configuration). You can configure a
divider for each section yourself by editing the $dividers, $div_ats and $div_atscr variables

"+" -> Show only the "Advanced Topics - Scripting" section entries
"+i" -> Advanced Topics - Scripting - Control Structures - If/ElseIf/Else Blocks

"#hi" -> Advanced Topics - Scripting Commands Reference - highlight
"#fol" -> Advanced Topics - Scripting Commands Reference - folderreport()
etc.
Last edited by highend on 27 Sep 2013 14:16, edited 12 times in total.
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Script: Invoke specific help topic (for scripters)

Post by klownboy »

Hey highend,
This certainly cuts down on the time to get the end result and that's the whole idea. Sometimes I think just hitting the tab quickly 3 times is just a fast as shift-tab for people that are not-so-great at typing...like me. I will definitely put this in as a catalog item or keyboard shortcut.

By the way, what is the technique used above to cut and paste your code in your post and not have it wrap?

Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: Script: Invoke specific help topic (for scripters)

Post by binocular222 »

Very nice idea indeed!
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

highend
Posts: 13033
Joined: 06 Feb 2011 00:33

Re: Script: Invoke specific help topic (for scripters)

Post by highend »

Hi Ken,

Don just did me a favor and improved the selection via the inputselect gui -> Probably with the next beta:
1. Enter search term (narrow it down to one result if possible)
2. Hit "enter"
-> Profit!
what is the technique
Technique? For me it's more like a bug. But it's not the forum software...
My editor is "Sublime Text" and word wrapping is on but it's the first time that I've seen this behavior...

The line that wasn't wrapped is the one starting with "$scriptingCommandReference". The "$scripting =" line is fine...

Regards,
Highend
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Script: Invoke specific help topic (for scripters)

Post by klownboy »

Hi highend,
The tweak you made to Scripter Help Topics, based on your request and Don's change, really did make it easier and quicker to get to your final destination.

Concerning the wrapping business, I can see as in your case with a huge line that will wrap numerous times that you would want it to wrap because it's so obvious that it wrapped, but in other cases where the line just barely wraps (e.g., only 2-20 characters wrap), I'd acually rather it didn't wrap because the end result can be confusing to someone looking at it and trying to decipher it.
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

highend
Posts: 13033
Joined: 06 Feb 2011 00:33

Re: Script: Invoke specific help topic (for scripters)

Post by highend »

Hi Ken,

The use of so many "wraps" confused me. I'll try to decipher your statement later *g*

I'm working on a modified version which will be easier to read and includes all section titles of the help file (so it isn't targeted at scripting users any more). I'll post it tomorrow.

Regards,
Highend
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: Script: Invoke specific help topic (for scripters)

Post by Marco »

Great script! :appl:
This goes straight into my Catalog.
One question: how did you pick all the topics, by hand?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

highend
Posts: 13033
Joined: 06 Feb 2011 00:33

Re: Script: Call specific help topics

Post by highend »

Current script can be found in the starting post.
Great script!
Thanks.
how did you pick all the topics, by hand?
Unfortunately, yes ;) But it wasn't so much work, I update the script command reference for my text editor (Sublime Text) whenever a new command get's added to XY, so it's mostly a few regexreplaces to get what I need in this script.

I'll have to dig a bit deeper into Help & Manual to see if I can compile a list of what I need from there (for future updates).
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: Script: Call specific help topics

Post by binocular222 »

Oh no,
Previous version is much better: It allow type-ahead-find (I do not press Tab to go through search bar, but type the first letter of the command instead).
With new revision, all commands are prefixed with same character, thus type-ahead-find is impossible.
btw, adding separation character and command name after its description is not really needed (cluttering the screen - my aesthetic)
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

highend
Posts: 13033
Joined: 06 Feb 2011 00:33

Re: Script: Call specific help topics

Post by highend »

I'll revert back to the previous system (each section uses it's own div character) with the next release.
adding separation character and command name after its description is not really needed
You mean the latter part of each entry, e.g.:

Code: Select all

@ addressbar
from:

Code: Select all

Adress Bar @ addressbar
I could change that, but it defeats the purpose of beeing able to stay in context if you use the searchbox.

Code: Select all

#<space>
Shows only scripting command reference entries (including the section name!) and I find it useful to see from which section I'll choose an entry.

Another issue if I don't display the "<divider> <chm section name>":
I have to duplicate all $section_<name> variables to create lookup lists. Very error prone when new commands / sections have to be added...

Other opinions of how to handle the displaying entries in the inputselect() window?
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: Script: Call specific help topics

Post by binocular222 »

Your revision still work well with these modifications:
- Remove leading space
- Repeat command name in "Scripting command reference" so that it looks like

Code: Select all

abs # abs
instead of

Code: Select all

 # abs
- Use <Tab> to align <separation character>
To sum up, each line should look like this:
Description <Tab> <Separation> <command>
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

highend
Posts: 13033
Joined: 06 Feb 2011 00:33

Re: Script: Call specific help topics

Post by highend »

Use <Tab> to align <separation character>
That doesn't look pretty... Unless I invent a function that indents all lines equally with tabs, I'll revert it to a single space.

Script was updated.

Changelog:
v1.0.2:
* + Added configurable variables for all sections
* * Removed tab indention to reallow one keystroke navigation
* * Removed the space separator between the divider and the keyword
* * Automatic duplication of keywords as descriptions for $section_ScriptingCommandReference
* to minimize further script command additions
* * General line layout now looks like:
* Description <Space> <Separator><Keyword>
Download it from the first post!
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Filehero
Posts: 2642
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Script: Call specific help topics

Post by Filehero »

Hi highend,

it's a shame, I only just stumbled over my ToDo to install this script, so I'm a bit too late to the party: great script, thanks a lot. :D


Cheers,
Filehero

Filehero
Posts: 2642
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Script: Call specific help topics

Post by Filehero »

To help my brain remembering certain things once and for all, a reminder for those like me who once in a while start wondering how to assign a keyboard shortcut to a Custom Toolbar Button (CTB). :mrgreen:

You don't need CTBs for that, instead User-Defined Commands (UDC) is the way to go. Here you cany easily assign any keyboard shortcut to your scripts. I've assigned <Alt>+<Space>, couldn't get any easier to find a specific help topic...


Cheers,
Filehero

Filehero
Posts: 2642
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Script: Call specific help topics

Post by Filehero »

Hi highend,

I just found myself having opened a battery of help windows. :lol:
Hence my question wether there is a feasible way to reuse an already opened help window for any subsequent lookup?


Thanks & cheers,
Filehero

Post Reply