Page 1 of 1
swap pane content script
Posted: 05 Aug 2009 15:18
by wc96
I tried the following trivial implementation to swap panes:
Code: Select all
focus P1; $p1_dir = "<curpath>";
focus P2; $p2_dir = "<curpath>";
focus P1; goto $p2_dir;
focus P2; goto $p1_dir;
but when used, they produce new pane on either side. I just couldn't figure out how to do this without creating extraneous panes.
Re: swap pane content script
Posted: 05 Aug 2009 15:41
by TheQwerty
Give this a try and see if it's any better:
Code: Select all
"Swap Pane Locations"
$pA = "<curpath>";
Focus("PI");
$pI = "<curpath>";
Goto("$pA");
Focus("PI");
Goto("$pI");
Re: swap pane content script
Posted: 05 Aug 2009 17:39
by wc96
TheQwerty wrote:Give this a try and see if it's any better:
Code: Select all
"Swap Pane Locations"
$pA = "<curpath>";
Focus("PI");
$pI = "<curpath>";
Goto("$pA");
Focus("PI");
Goto("$pI");
I think this does not work either.
both of our scripts works when part of a Load Script file.
but if I define it in Run Script, it produced extraneous panes.
Re: swap pane content script
Posted: 05 Aug 2009 17:52
by TheQwerty
I'm guessing you're assigning a hotkey to this UDC which contains Shift, am I right?
Shift+ the normal goto functions opens the location in a new tab, and I'm guessing Don forgot to ignore this situation when opening a location in a script.
So this seems to be a bug in Goto, but you should be able to avoid it by not assigning a shortcut using Shift to this script.
(This also explains why I couldn't get your's or mine to fail originally.)
Re: swap pane content script
Posted: 05 Aug 2009 18:00
by jacky
TheQwerty wrote:So this seems to be a bug in Goto, but you should be able to avoid it by not assigning a shortcut using Shift to this script.
I'm not sure this is a bug, this is known and how it works, probably even classified a feature. Also, on your UDC just check "On KeyUp" and - unless you keep your finger on Shift for a while - that should solve the problem...
Re: swap pane content script
Posted: 05 Aug 2009 18:36
by TheQwerty
jacky wrote:TheQwerty wrote:So this seems to be a bug in Goto, but you should be able to avoid it by not assigning a shortcut using Shift to this script.
I'm not sure this is a bug, this is known and how it works, probably even classified a feature. Also, on your UDC just check "On KeyUp" and - unless you keep your finger on Shift for a while - that should solve the problem...
Unfortunately On KeyUp doesn't wait for Shift to be up so it's just as useless as having it be triggered on KeyDown for this case.
If this is intended behavior it's not good and I think it should definitely be changed. There is no way to predict the behavior of a script when it is triggered by a Shift+... shortcut with this; which will be more confusing to the user in the end (evident by this thread) than if script writers had to adjust and open the tab in the script (or use logic and two shortcuts to achieve the same behavior).
Re: swap pane content script
Posted: 05 Aug 2009 21:32
by wc96
TheQwerty wrote:I'm guessing you're assigning a hotkey to this UDC which contains Shift, am I right?
Shift+ the normal goto functions opens the location in a new tab, and I'm guessing Don forgot to ignore this situation when opening a location in a script.
So this seems to be a bug in Goto, but you should be able to avoid it by not assigning a shortcut using Shift to this script.
(This also explains why I couldn't get your's or mine to fail originally.)
yes, that's exactly right, I used shift-W for swapping the panels. now I understand why this is happening.
No key up doesn't solve it, just tried that one. Looks like only soln is to reassign to a non-shift based shortcut.
Yes working now! reassigned to the never used [`] key and it works out beautifully on both scripts, although I like yours better for brevity.
Re: swap pane content script
Posted: 13 Aug 2009 20:33
by petersboulton
Is it possible to MOVE a tab to the other pane? As in:
1) Squirrel focus tab path in active pane
2) Create new tab in inactive pane
3) Goto squirreled path from active pane in new pane
4) Delete (close) focus tab in active pane
5) Set focus to the new tab in what was previously the inactive pane and make it active.
I am a complete newbie on scripts but looking back at the previous posts I reckon (2) is the difficult (impossible?) bit. Hopefully I'm wrong there.
Alternatively, how long will it be for dragging between panes to be implemented in core product? I'd have thought it is something everyone would want?
Thanks.
Pete
Re: swap pane content script
Posted: 13 Aug 2009 23:52
by TheQwerty
petersboulton wrote:Is it possible to MOVE a tab to the other pane?
Kind of...
Code: Select all
"Open Location In Inactive Pane"
$pA = "<curpath>";
#351; //Close Tab
Focus("PI");
#340; //Open Tab
Goto("$pA");
Focus("List");
The problem is that you can't easily copy the list view settings and tab history to the new tab.
But it's easy to get the tab's location, close the tab, switch panes, open a new tab, and goto the stored location.
If you're using the Folder View Settings it's not quite as bad, but still not perfect.
EDIT: Just to add, you could conceivably keep all of the tab's settings/history if you don't mind suffering through a settings save and restart of XY. (Though it would still be quite a bit of work to transfer everything between the pane.ini files.)
petersboulton wrote:Alternatively, how long will it be for dragging between panes to be implemented in core product? I'd have thought it is something everyone would want?
I'm sure it will come, but I think Don's taking a little time away from Dual Pane code to let the dust settle and mature a bit. Plus, to give the Single Pane lovers something in the updates.
Re: swap pane content script
Posted: 14 Aug 2009 10:49
by petersboulton
Thanks TheQwerty! Your script does the job for me!
I take your point on letting the dust settle on dual pane. Although, on the other hand, there has been ?? years development for single pane and a month or two since the first DP release, so I would expect there to be bigger fruit to pick for DP! And rearranging tabs between panes seems pretty fundamental (to me at least) to a DP file manager.
In the meantime though, your script is great - many thanks for taking the trouble to respond!
Pete
Re: swap pane content script
Posted: 14 Aug 2009 15:04
by admin
petersboulton wrote:...so I would expect there to be bigger fruit to pick for DP...
Sorry? Could you translate this into German, please?

Re: swap pane content script
Posted: 14 Aug 2009 15:35
by petersboulton
admin wrote:petersboulton wrote:...so I would expect there to be bigger fruit to pick for DP...
Sorry? Could you translate this into German, please?

Entschuldigen Sie bitte! Sorry, I meant that given that DP was so new there would be more opportunities for
significant enhancements (like dragging tabs between panes), whereas SP is so mature (having been around since the start) that the opportunity to add major new features must be much less.
I may be wrong in thinking that of course!
Either way, I cling to the opinion that dragging tabs between panes is something you would definitely expect from a DP file manager.
Hope my fruit analogy is clearer now - sorry for any confusion!
Pete
Re: swap pane content script
Posted: 14 Aug 2009 15:44
by admin
petersboulton wrote:admin wrote:petersboulton wrote:...so I would expect there to be bigger fruit to pick for DP...
Sorry? Could you translate this into German, please?

Entschuldigen Sie bitte! Sorry, I meant that given that DP was so new there would be more opportunities for
significant enhancements (like dragging tabs between panes), whereas SP is so mature (having been around since the start) that the opportunity to add major new features must be much less.
I may be wrong in thinking that of course!
Either way, I cling to the opinion that dragging tabs between panes is something you would definitely expect from a DP file manager.
Hope my fruit analogy is clearer now - sorry for any confusion!
Pete
Ok, thanks.
Dragging tabs between panes is on the list of course.
BTW, I would not call SP a feature. It's
the thing that has features.

Re: swap pane content script
Posted: 14 Aug 2009 20:02
by TheQwerty
Thanks to serendipity for
reminding me about the "Copy List Settings from Other Pane" (1071) command.
This helps the script become a little more useful (and can also aid in triggering epileptic seizures with all the pane switches

).
Code: Select all
"Open Location In Inactive Pane & Migrate List Settings"
$pA = "<curpath>";
Focus("PI");
#340; //Open Tab
Goto("$pA");
#1071; //Copy List Settings from Other Pane
Focus("PI");
#351; //Close Tab
Focus("PI");
Re: swap pane content script
Posted: 21 Aug 2009 22:14
by aurumdigitus
A huge
tip of the hat to TheQwerty for making the Swap Pane script available! This is the first one I've used that really added a new feature to xy and is ineffably impressive.
