Page 1 of 2

Contextual help [Preview]

Posted: 07 Jun 2014 12:48
by binocular222
While waiting for the wish here http://www.xyplorer.com/xyfc/viewtopic. ... 54#p106154
I make a preview.

Usage:
1) Open the .ahk file with Autohotkey.exe (version 1.1: http://ahkscript.org/download/) OR comply that .ahk file to .exe using http://ahkscript.org/download/ahk2exe.zip
2) While Batch rename/PFA/QNS/VF dialog is active, Press F1 will trigger the relevant "XYplorer contextual help".
3) You can edit the help text in the "XYplorer contextual help" window,
4) X-Close/escape that window will auto save changes. Right-click the edge of window (except Title bar) will close without save changes
(*) There're some tidbit grace:
- The help window will not overlap VF/QNS... dialog.
- Close the VF/QNS... dialog will close the help window too (without saving chages to help file)
(*) Customize the .ahk file:
- Don't want the icon in tray? Uncomment the 2nd line (#notrayicon)
- Want a borderless help window? Change from "+Caption" to "-Caption"
Untitled20140607223612.png
Untitled20140607223612.png (80.65 KiB) Viewed 5207 times
As a preview, it's raw until Don implement the above wish, so vote for me!

Re: Contextual help [Preview]

Posted: 07 Jun 2014 13:09
by Stef123
It won't load up, here's what it says:
Error at line 24
The following variable name contains an illegal character: "File.Encoding"

Re: Contextual help [Preview]

Posted: 07 Jun 2014 13:44
by binocular222
1) Make sure you run atleast AHK_L 1.1 http://ahkscript.org/download/
2) Still not work? Just delete line 23,24,25 (it's a false safe but not quite necessary)
3) Still no? Use the complied .exe below

Re: Contextual help [Preview]

Posted: 07 Jun 2014 14:24
by Stef123
Didn't know AHK comes in so many flavors. With 1.115_x64 Unicode your script works like a charm.
A-W-E-S-O-M-E :appl: :appl: standing ovations
Wishing only we would have had this talk earlier. Still hitting me at a good time, though, because it got too exhausting for me to go the extra mile via the language file edit.
Must go over to the other thread and endorse your suggestion.

Re: Contextual help [Preview]

Posted: 07 Jun 2014 14:58
by binocular222
Updated 1st post, Now, it can detect Batch rename/PFA/QNS/VF
Did I missed something?
OK, in List Management, tons are still in-distinguishable (CFI, Addressbar and to go...), we have to wait for Don...

Re: Contextual help [Preview]

Posted: 07 Jun 2014 17:12
by Stef123
Getting all revved up on this - this is exactly what I had been hoping for when I started editing the language file.
Thank you, binocluar222 - I am really glad you had this idea.

PFA always works fine.
QNS also comes up reliably - but - after it was up, it overrides VF and BR, meaning, if I trigger VF or BR after QNS had been used, the QNS help will come up instead of VF or BR respectively.

Re: Contextual help [Preview]

Posted: 07 Jun 2014 17:26
by binocular222
All works fine here (notice I updated to v0.3).
If still, throw a message box around to catch bug, i.e:

Code: Select all

FileRead, InitialText, %Location% ;<-- thow after this line
Msgbox %Location%
Should show the correct .txt file.
Besides, check the content of Batch Rename.txt, PFA.txt, QNS.txt, Visual Filter.txt

btw, my PFA.txt now look like this:

Code: Select all

"Caption|<xyicons>\something.ico" pattern1;pattern2;pattern3>application

png;jpg>C:\Programs\Viewer\Viewer.exe
png>..\Viewer\Viewer.exe          [relative to the application path]
png>?:\Programs\Viewer\Viewer.exe [? = application drive]
txt>%windir%\Notepad.exe          [variables allowed]
readme.txt>notepad                [registered applications need base name only]
|"Notepad" *>Notepad              [pipe "|" in the beginning = Portable Open With: Only appear in PFA popup menu]

*.exe>::copytext <curver>         [copies the version number of a dbl-clicked executable]
xys>::Load <curitem>
"Winrar" rar;zip>"?:\7Utilities\WinRAR x%osbitness%\WinRAR.exe" -a  [command-line + adapt to x32-x64]
"Java|Java" jar>::run "java.exe -jar <pfaitem>"
?:\*.pdf>?:\Programs\pdfview.exe  [load PDF files on app drive with a viewer on app drive]
Hope that many one will share their knowledge

Re: Contextual help [Preview]

Posted: 07 Jun 2014 17:52
by Stef123
One step closer. Everything seems to work except for BR. It doesnt come up at all, anymore. When I press F1, it toggles the built-in i-window to show.

Inserting the message box line brings up the right path for the other 3, but not for BR, where nothing happens at all (AHK-wise). F1 will only pop up the built-in info that comes with XY.

Maybe it has to do with the modified language file I still have in use? However, the window caption is the same as in the original, and it did indeed come up a few times, after all, with your earlier scripts.

Code: Select all

"Caption|<xyicons>\something.ico" pattern1;pattern2;pattern3>application
...
[pipe "|" in the beginning = Portable Open With: Only appear in PFA popup menu]
2 hints I had missed out on. Your system is already beginning to pay off. :D

Re: Contextual help [Preview]

Posted: 07 Jun 2014 18:03
by binocular222
If you modified the language file, then this check fail:

Code: Select all

Else if(SubStr(OutputVar, 1, 27) = "All examples are applied to")
	Location = %A_ScriptDir%\Batch Rename.txt
Essentially, it read the first 27 characters from XYplorer's "i" button. To view & copy that 27 character to clipboard:

Code: Select all

WinGetText, OutputVar, A
OutputVar := trim(OutputVar, "`r`n `t")
Test := SubStr(OutputVar, 1, 27)
msgbox %Test%
clipboard := Test

Re: Contextual help [Preview]

Posted: 07 Jun 2014 18:09
by Stef123
Got it. That's the catch, of course. You don't simply refer to the window caption, but to the first lines of the i-info-box itself.

That's smart, really smart, because you will get the Visual Filters help also for the Selection Filter - provided you did not change your language file. And if you did, well, just note the difference and replace the line in the ahk-script.

:appl: :appl:

Re: Contextual help [Preview]

Posted: 07 Jun 2014 18:21
by Stef123
Is it necessary to have all text selected when it comes up? Afraid to hit a key accidentally and overwrite/ delete everything.

Re: Contextual help [Preview]

Posted: 07 Jun 2014 18:36
by binocular222
! fixed in v0.4 by this line: Sendinput ^{Home}
+ added 2 more recognizable dialog

Re: Contextual help [Preview]

Posted: 07 Jun 2014 19:01
by Stef123
Where do I trigger the Script-file? I am not into XY scripting (yet), but just for my records, so I can comment the ahk-script.

Re: Contextual help [Preview]

Posted: 07 Jun 2014 19:07
by binocular222
User > Manage Command > Run Script > Edit...
btw, up coming v0.5 will fix the "unable to press Tab" while edit inside the help window

Re: Contextual help [Preview]

Posted: 07 Jun 2014 19:07
by bdeshi
This is one of the best uses of AHK with XY! :appl: