Folder Pane Preview

Discuss and share scripts and script files...
bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Folder Pane Preview

Post by bdeshi »

Too complicated. Sorry.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

pleiades
Posts: 52
Joined: 13 Aug 2016 10:36

Re: Folder Pane Preview

Post by pleiades »

No problem, Thank you for this wonderful script :tup: :tup:

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Folder Pane Preview

Post by bdeshi »

Released v1.3 - see first post attachment.

NEW FEATURES
  • Does not immediately stop if the Preview Tab is focused.
    This allows for customization of the tab view mode, columns etc on the fly and still keep the preview running.
    (Note that the preview is still closed if any other tab on the second pane is activated.)
  • Added Pane splitting control.
  • "Restore last layout" if enabled, restores pane split direction along with dual pane.
CHANGES / BUGFIXES
  • Removed "Enable Dual Pane on Start" option. It's hard-coded to "on", because the script is useless otherwise.
  • Uses the new ID Parameter to detect tabs. More reliable.
  • Stopped unnecessary menu popup after first run configuration.
NOTES
  • Please review configuration to adjust newly introduced settings.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Folder Pane Preview

Post by klownboy »

Hi Sammay, I noticed when I tried the new version that when I set the config to vertical panes and adjusted the width to what I wanted that on a subsequent run of the script the panes were no longer sized as I previously left them (even though I saved). I discovered that it was my own script (via CTB) which sets a layout that I return to quite often...it's a typical or my normal layout. Well, the layout text file has a vertical pane size for Pane 1 and 2. I don't normally use vertical panes. When I go dual pane it's usually in horizontal mode. Anyway, after setting the vertical pane widths in my normal layout file, the vertical pane widths were the same each time I entered Folder Pane Preview. If I went to dual pane in my normal setup, it would go to my normal horizontal pane mode and this is exactly what I wanted. It should work if a user simply 'saves' when in vertical pane mode, but in my case I had a layout which overrode the save. I figured I'd mention this since someone who uses layouts can set their vertical pane widths that they desire for your Folder Pane Preview in the layout file and still have the normal horizontal pane layout in their normal setup.

I'm not sure if this was the case previously, but I noticed that I could go to a different tab in pane 1 while in Folder Pane Preview and it would remain in Folder Pane Preview which is a nice feature.

Great script Sammay. :tup: Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Folder Pane Preview

Post by bdeshi »

Thank you too! :tup:
klownboy wrote:I could go to a different tab in pane 1 while in Folder Pane Preview and it would remain in Folder Pane Preview which is a nice feature.
Yep, it's an old feature, controlled by the checkbox "Allow tab switching".
klownboy wrote:in my case I had a layout which overrode the save. I figured I'd mention this since someone who uses layouts can set their vertical pane widths that they desire for your Folder Pane Preview in the layout file and still have the normal horizontal pane layout in their normal setup.
Good to know.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Folder Pane Preview

Post by klownboy »

Hey Sammay, have you tried the script since beta v18.50.0107 (which brought new SC runq to solve quoting issues)? The script is failing with an overload errors when I exit from Folder Pane Preview. I believe the problem is in the suggested left and right CTB commands. I'm having issues with other scripts like the following that worked fine for me previously...loads a folder of shortcuts in a new instance with XY sized and a layout loaded. Thanks.

Code: Select all

   run """<xy>"" /new ""C:\Users\ken\Tools\"" /win=normal,550,130,220,812 /script=""::loadlayout('list');if !(get('View')='2'){#304};open 'D:\Tools\AutoHotkey\AHKscripts\TB_XY_hide.ahk';""", , 0, 0;
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Folder Pane Preview

Post by bdeshi »

Did not get a chance to have .0107, but seems to work fine again with 18.50.0116. Maybe due to this revert:

Code: Select all

    - Command Line Switches: This change from v18.50.0107 - 2017-10-26 17:40 had
      to be withdrawn because of undesired side effects:
        Now this works as well:
          /script="::run quote("E:\Test\Has Space.txt");"
      No, you cannot have double-quotes inside a double-quoted script in this
      context.
Can you confirm?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Folder Pane Preview

Post by klownboy »

Hi Sammay, yes it does work again. I was just about to post that it now works v18.50.0116 when I saw your post. Thanks Don.

Don uses one set of double quotes (between /script= and ::) in most of his examples except in the help file under the Command Line switches | /hwnd section. Here he uses 2 sets of double quotes maybe because of the message 'Hi!' quote?

Code: Select all

run "<xy> /script=""::msg 'Hi!';"" /flg=2 /hwnd=<hwnd>", , 0, 0;   //from the help file
I have to use 2 sets of double quotes in this example for it to work.

Code: Select all

 run """<xy>"" /new ""C:\Users\ken\Tools\"" /win=normal,550,130,220,812 /script=""::loadlayout('list');if !(get('View')='2'){#304};open 'D:\Tools\AutoHotkey\AHKscripts\TB_XY_hide.ahk';""", , 0, 0;
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Folder Pane Preview

Post by bdeshi »

klownboy wrote: Here he uses 2 sets of double quotes maybe because of the message 'Hi!' quote?

Code: Select all

run "<xy> /script=""::msg 'Hi!';"" /flg=2 /hwnd=<hwnd>", , 0, 0;   //from the help file
(No, or I think we're talking about the same thing) because ::msg 'Hi!'; this string has to be quoted in the commandline, but the entire command is already within quotes. Hence that string has quotes doubled.

This kind of headache is why I'm making a habit out of favoring concatenation to interpolated quotes and variables (as long as the concat statement is somewhat comprehensible).

Code: Select all

::?run quote(<xy>) . " /script=" .  quote("::msg 'Hi!';") . " /flg=2 /hwnd=" . <hwnd>, , 0, 0;
So, all good. :tup:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

WirlyWirly
Posts: 195
Joined: 21 Oct 2020 23:33
Location: Through the Looking-Glass

Re: Folder Pane Preview

Post by WirlyWirly »

Hey SammaySarkar, thanks a bunch for this script! This is just the type of functionality I've been trying to accomplish!

I'm having an issue where every time I close and then re-open xyPlorer, I need to go through the first run process for the script again. After I go through that, if I run the same command I used to load the script, then instead of stopping the script, it goes through the first run process again. Only by using Esc will the script stop and then the command will start toggling the preview on/off as intended.

For reference, I'm running the script via a keyboard shortcut, using the command you provided in the OP, while vertical dual-panes are already active. I don't use catalogs/trees or anything, just dual-panes...

Manage User-defined Commands
Image

Script Line

Code: Select all

$s="<xyscripts>\SammaySarkar\FolderPanePreview.xys"; $f='$FPP_Do_Preview'; run """%ComSpec%"" /c """"<xy>"" /script=""::global $f=1;load '$s';"" /flg=2 /hwnd=<hwnd>""""",,0,0;
Script Configuration
Image

Any tips on what I might be doing wrong?

Also, though this isn't related to your script, but whenever I use Esc to stop a running script, I get this little pop-up. Pretty annoying, also redundent since the status bar says the same thing. Anyone know of a tweak to disable it?

Image
Last edited by WirlyWirly on 21 Nov 2021 20:47, edited 2 times in total.

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

Re: Folder Pane Preview

Post by highend »

Configuration | General | Refresh, Icons, History | Scripting | Remember permanent variables

not ticked?
One of my scripts helped you out? Please donate via Paypal

WirlyWirly
Posts: 195
Joined: 21 Oct 2020 23:33
Location: Through the Looking-Glass

Re: Folder Pane Preview

Post by WirlyWirly »

No it was not, thanks highend, that seems to have done the trick! I belive the script is working as intended now.

Got any solutions for that Esc popup though? I use Esc like it's a vowel, so that warning gets in my way pretty often. It's never once either, I usualy gotta exit it a few times before it finally goes away.

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

Re: Folder Pane Preview

Post by highend »

Afaik there isn't anything to stop that and imho that's fine. People should know if a script was exited by hitting esc. Write an .ahk script that auto-closes that dialog...
One of my scripts helped you out? Please donate via Paypal

WirlyWirly
Posts: 195
Joined: 21 Oct 2020 23:33
Location: Through the Looking-Glass

Re: Folder Pane Preview

Post by WirlyWirly »

I use this script quite a bit and noticed a small bug today. Not a deal-breaker, but it stumped me for a few minutes and had me digging through my settings to figure out what I did wrong...

When I have the preview active, I'm unable to drag-and-drop from XY to other locations. This includes other tabs/panes/programs. I get the 🚫 icon while hovering.

Using the latest version of this script and XY v23.00.0007. Having the Extend Compatibility option enabled/disabled has no effect.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Folder Pane Preview

Post by bdeshi »

Hi @WirlyWirly thanks for using the script. Unfortunately I'm not using XYplorer or WIndows anymore, but will try to look into this some time.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply