Folder Pane Preview
Posted: 26 Sep 2017 22:23
This lets you select a folder in the first pane, and preview its contents on the second pane.
(Born out of this discussion)
Once started it keeps running in the background to continuously sync the preview pane to the current folder selection. Run it again to toggle off.
Hope you find this useful. Let me know about any bugs or improvements.
Once started it keeps running in the background to continuously sync the preview pane to the current folder selection. Run it again to toggle off.
- FEATURES
- Dedicated Icon!
- auto-updating preview.
- Customizable preview tab.
- You should get a "readme" followed by the config on the first run.
- The preview always opens on the second (right/bottom) pane.
========= INSTALL =========- Loading the script by itself shows a menu with preview and config choices. But of course you can also start preview and config directly.
- Outside of CTB and UDC (eg, from catalog, other scripts, address bar, regular load, etc), you can call the script very easily:
- Show menu
Code: Select all
::load 'folder-pane-preview.xys'; - Toggle Preview
Code: Select all
::global $FPP_Do_Preview = 1; load 'folder-pane-preview.xys'; - Open Config
Code: Select all
::global $FPP_Do_Config = 1; load 'folder-pane-preview.xys';
- Show menu
- However, due to the script's fighting with certain technical limitations of the scripting engine, associating with CTB and UDC may be a little involved.
- UDC/CTB Integration Scripts:
- Use these for CTB Left/Right-click scripts and UDC Run Scripts.
- Show menu[/size]
Code: Select all
$s='folder-pane-preview.xys'; run """%ComSpec%"" /c """"<xy>"" /script=""::load '$s';"" /flg=2 /hwnd=<hwnd>""""",,0,0; - Toggle Preview[/size]
Code: Select all
$s='folder-pane-preview.xys'; $f='$FPP_Do_Preview'; run """%ComSpec%"" /c """"<xy>"" /script=""::global $f=1;load '$s';"" /flg=2 /hwnd=<hwnd>""""",,0,0; - "Open Config"[/size]
Code: Select all
$s='folder-pane-preview.xys'; $f='$FPP_Do_Config'; run """%ComSpec%"" /c """"<xy>"" /script=""::global $f=1;load '$s';"" /flg=2 /hwnd=<hwnd>""""",,0,0; - Now you can create a CTB using these as left-click and right-click scripts.
Here's an example where, Click = preview, SHIFT+Click = config.(In all of these scripts $s should point to the location of folder-pane-preview.xys.)Code: Select all
$s='folder-pane-preview.xys'; $f='$FPP_Do_'.(get('shift')==1?'Config':'Preview'); run """<xy>"" /script=""::global $f=1;load '$s';"" /flg=2 /hwnd=<hwnd>";
- Stopping the preview
Once started, the script stays running in the background. There are many ways to stop.- Simply run the preview again. This works as a toggle.
- Switch panes. Depending on config, the preview pane may stay, but the script will stop.
- Disable Dual Panes.
- Switch tabs may also work, depending on config.
- Press Esc.
- The script also stops whenever XY executes an end 1,,0; statement.
- And a final note, since the script may get called often while already running, you might get warnings regarding recursive script execution. To turn this off (it is quite safe) set `ScriptRecursionWarningOff=1` in XYplorer configuration file.
Hope you find this useful. Let me know about any bugs or improvements.