Quasi-Dual Pane (QDP)

Discuss and share scripts and script files...
Post Reply
TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Quasi-Dual Pane (QDP)

Post by TheQwerty »

This script uses the preview pane as a quasi-dual pane.

It does the following:
Asks the user which folder to open in the new pane (defaults to the current path).
Creates an HTML page in the current path named "QDP-<dhhmmss>.html" (which refreshes/links to the selected path).
Previews the file.


This should convert the XY preview pane into an embedded explorer window. You'll then be able to drag files from the preview pane to XY just fine, and you can rename and (clumsily) explore.
One interesting advantage is you're able to use the standard undo on some actions that took place in XY (deleting files).


The unfortunates:
It seems all of the scriptable preview/info panel commands only work as toggles so the behavior will differ depending on whether or not you have the info panel visible at execution.

I can't find a way to get it to display the tree or catch all of its normal shortcut keys, so navigating is a bit clumsy, but not impossible.

Dragging from XY to the preview pane is impossible because it will close the preview.
Dragging from the pane to XY does work, but will usually close the preview as well.
Perhaps the easiest way to go between the two panes is to use the catalog and "Copy All Items in Category" context menu item (though, like dropping, this will close the preview).

There's no good way for this script to clean up after itself and remove the temp file that it creates, sorry but you are on your own there.

Enjoy!

Code: Select all

"QDP : qdp"
	InputFolder($path, "<curpath>", "Folder to open in lower pane:");
	Set($cb, "<clipboard>");
	CopyText("<html><head><meta http-equiv=""Refresh"" content=""0; url=file:///$path"" /></head><body><a href=""file:///$path"">$path</a></body></html>");
	#219;	//Paste to file.
	CopyText("$cb");
	Focus("List");
	Rename("bat", 'QDP-<datec hhmmss>.html/e');
	#260;	//Show Find Files
	#174;	//Show Preview

Requires: XYplorer v7.60.000+

  • Updates:
  • 2008-09-17 - Updated to use new script syntax.
Last edited by TheQwerty on 17 Sep 2008 20:14, edited 5 times in total.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Quasi-Dual Pane (QDP)

Post by admin »

Mind-bloggling! :D I did not believe it until I saw it. Nice trick to use that META tag! Pity, that it's not very useful, especially because the Preview likes to update/close that often (which, of course, I could stop -- but then, in normal usage, this is done for good reasons).

BTW, I once tried to preview ZIPs using the embedded IE, and it works fine (if you enable zip-folders in Explorer). So, you also can write a script that previews a zip file in XY's preview...

BTW #2: I could feed that "file:///..." also directly into the Preview (without creating any file), IOW preview a folder (which has been wished here a number of times). I would have done it already if I could better control the display, but I can't. It's always a big icons list with abc-sorting... :(

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Post by PeterH »

What an effect :o :shock:

But a problem:

If I run script in step-mode, everything works fine - but preview is terminated after last command. (It can easily be restarted by selecting another file, then .html-file again.)
If I run script without step-mode, there is a very strange problem:
- preview-pane is empty
- in list the filename of new file *with it's initial name* (i.e. Clipboard-20080503.txt) is shown in selected state (for rename), *but* the column "Ext" shows "html"!
- if I press Enter, File is renamed back to old name (as shown) - and the text of the .txt-file is previewed, not executed.
- if I press escape, the (shown) filename changes to QDP-051625.html, but preview still is empty. Clicking other file, then this .html again shows expected result...
Any idea, what this can be?

And a question: the new filename is QDP-<dmmhhss>.html - that seems to be month-hour-second? Should have been <dhhnnss> or something like that?

(By the way: people having replaced Win Explorer by XY - do they see XY in preview pane???)

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

admin wrote:Preview likes to update/close that often (which, of course, I could stop...
It's certainly not worth changing from my point of view. I stumbled on this "feature" by accident and this was mostly just a proof of concept. Now if changing the way the preview works to make this better would be seen as an acceptable solution to all the DP requesting... :D
admin wrote:I would have done it already if I could better control the display, but I can't. It's always a big icons list with abc-sorting... :(
Yeah, the default view is always the same and it's a very restricted explorer. The only way I could think of to handle that would be to look into using an ActiveX control or do a lot more scripting within the generated HTML (i.e. a lot more effort than I'm willing to put into it).
PeterH wrote:But a problem:

If I run script in step-mode, everything works fine - but preview is terminated after last command. (It can easily be restarted by selecting another file, then .html-file again.)
If I run script without step-mode, there is a very strange problem:
- preview-pane is empty
- in list the filename of new file *with it's initial name* (i.e. Clipboard-20080503.txt) is shown in selected state (for rename), *but* the column "Ext" shows "html"!
- if I press Enter, File is renamed back to old name (as shown) - and the text of the .txt-file is previewed, not executed.
- if I press escape, the (shown) filename changes to QDP-051625.html, but preview still is empty. Clicking other file, then this .html again shows expected result...
Any idea, what this can be?
No idea. I'm not seeing that behavior. As I said in the first post unfortunately there's no script command to just show the preview; they all perform toggles, so if you start with the preview visible it will turn it off in the end. Perhaps that is part of the problem? Might be able to get around that with a lot more scripting but it doesn't seem worth it.
PeterH wrote:And a question: the new filename is QDP-<dmmhhss>.html - that seems to be month-hour-second? Should have been <dhhnnss> or something like that?
Small typo, it should have been hhmmss, or anything you want, I just wanted something that wouldn't cause much conflict. The date formatter is intelligent enough to pay attention to the context when using mm, so if it follows hh it's minutes.
PeterH wrote:(By the way: people having replaced Win Explorer by XY - do they see XY in preview pane???)
I don't imagine that would be the case, but I suppose it might open/focus an instance of XY instead.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Quasi-Dual Pane (QDP)

Post by admin »

TheQwerty wrote:It seems all of the scriptable preview/info panel commands only work as toggles so the behavior will differ depending on whether or not you have the info panel visible at execution.
#174; (menu File/ Preview) does show the Preview Panel always.

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Quasi-Dual Pane (QDP)

Post by PeterH »

admin wrote:#174; (menu File/ Preview) does show the Preview Panel always.
That's right - I always see the Preview Panel. The only problem: it's empty!
And as I said: if I just click another file it's immediately previewed, and then click .html it's previewed, too.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Quasi-Dual Pane (QDP)

Post by admin »

PeterH wrote:
admin wrote:#174; (menu File/ Preview) does show the Preview Panel always.
That's right - I always see the Preview Panel. The only problem: it's empty!
And as I said: if I just click another file it's immediately previewed, and then click .html it's previewed, too.
This has reasons that make sense in other contexts.

Tip: The ::goto command with the HTML file as argument will force a preview.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

Haven't really tried all the posible combo, but I'm thinking something like this should always end up with the Panel shown, on Preview tab, previewing the focused&selected file (if any), regardless of whether panel was visible or not/previewing or not...

Code: Select all

::#260;#174;
Proud XYplorer Fanatic

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Post by PeterH »

jacky wrote:Haven't really tried all the posible combo, but I'm thinking something like this should always end up with the Panel shown, on Preview tab, previewing the focused&selected file (if any), regardless of whether panel was visible or not/previewing or not...

Code: Select all

::#260;#174;
Now, after the temporary bug with "Copytext ... Append" is gone, this works well for me - in Step-Mode!

But as said before: for non-stepmode, the rename-command shows very strange behavior: the rename seems as if not beeing done, instead the created file is shown with old name and as editable. If I press Esc it changes to the (correct) new name :!:
If an executable command follows in script, (i.e. #174=Preview if *not* in preview-mode), the file will automatically be renamed back(!!!) to the old name "Clipboard....txt"), as if Enter was pressed! So the situation with the editable filename can only be seen if no further command is executed. (This is especially not the case, if #260;#174 follows the rename, as at least one of these leads to a change.)

No idea to this situation?
And nobody with an effect like this?

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

PeterH wrote:
jacky wrote:Haven't really tried all the posible combo, but I'm thinking something like this should always end up with the Panel shown, on Preview tab, previewing the focused&selected file (if any), regardless of whether panel was visible or not/previewing or not...

Code: Select all

::#260;#174;
Now, after the temporary bug with "Copytext ... Append" is gone, this works well for me - in Step-Mode!

But as said before: for non-stepmode, the rename-command shows very strange behavior: the rename seems as if not beeing done, instead the created file is shown with old name and as editable. If I press Esc it changes to the (correct) new name :!:
If an executable command follows in script, (i.e. #174=Preview if *not* in preview-mode), the file will automatically be renamed back(!!!) to the old name "Clipboard....txt"), as if Enter was pressed! So the situation with the editable filename can only be seen if no further command is executed. (This is especially not the case, if #260;#174 follows the rename, as at least one of these leads to a change.)

No idea to this situation?
And nobody with an effect like this?
Yes, I have the same effect here. Currently no time though to investigate further.

EDIT: Okay, I shortly looked into it. The problem is connected to function -#219 (Edit | Paste Special | Paste Text Into New File): it enters rename mode, a GUI thing that does not play nicely with a running script.

The solution to this will come with scripting 2.0 where you can simply create a file with a certain content, without the need for any clipboard tricks.

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Post by PeterH »

Good to hear that there's a reason for this, thanks!
No problem to wait...

Post Reply