I really like the catalog feature.
Most of the time I work with folder pairs.
Is it possible to create a catalog function that will navigate both panes to a folder pair?
Folder/File pairs
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Folder/File pairs
Yes you can create such a folder pair.Slowfox wrote:I really like the catalog feature.
Most of the time I work with folder pairs.
Is it possible to create a catalog function that will navigate both panes to a folder pair?
Right-click on catalog and "Add new item here". At the end of the location field click edit button and paste this code:
Code: Select all
//Folder pairs for dual pane
focus P1;
goto "Desktop";
focus P2;
goto "My Documents";
Re: Folder/File pairs
This is great. It does what I want.
It is a bit of a pain, though, to key in all the paths.
Suggestion: Make "Favorite/Catalog Dual Pane" a factory feature.
Thanks.
It is a bit of a pain, though, to key in all the paths.
Suggestion: Make "Favorite/Catalog Dual Pane" a factory feature.
Thanks.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Folder/File pairs
If you don't want to key in, you can also browse for folder pair paths for pane 1 and 2 using below script.Slowfox wrote:This is great. It does what I want.
It is a bit of a pain, though, to key in all the paths.
Suggestion: Make "Favorite/Catalog Dual Pane" a factory feature.
Thanks.
Code: Select all
//Create Folder pairs script for catalog
$path1=inputfolder (<get path 1>, "Path for pane 1");
$path2=inputfolder (<get path 2>, "Path for pane 2");
$text= "focus P1; goto ""$path1""; focus P2; goto ""$path2"";";
copytext $text;
text $text;
Last edited by serendipity on 08 Feb 2012 23:06, edited 1 time in total.
-
PeterH
- Posts: 2826
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Folder/File pairs
Hi serendipity,
sorry to break into this, but I think there's something "dangerous" in your script:I think the first string is "strange"...
Help says (with reason):
It's strongly recommended that you (double- or single-) quote your strings! While the script engine is currently still permissive with unquoted strings (msg Hi! works) this might not be so in the future, so you better do msg "Hi!" right away!
Help / Advanced topics / Scripting / General Command Syntax / Using Quotes in Scripting
(Having written this pointer to the place in help I remember why I don't like the way help is organized. Sorry, Don...)
But your string starts and ends with ( and ), not being in quotes. And then both () are stripped in the next line...
(I assume I know why you did it this way: the double quotes around the pathes.)
I think one possible coding would be:This is a well quoted string, and quotes inside the string are doubled.
A less elegant version:Here the string is in single quotes - so double quotes are allowed. But as no substitution takes place inside single quotes the variables must be outside the quotes, and concatenated by the dots.
(The blanks around the dots are only for readability and have no meaning.)
sorry to break into this, but I think there's something "dangerous" in your script:
Code: Select all
$text= ("focus P1; goto "$path1"; focus P2; goto "$path2";");
$text=substr($text,1,-1);
Help says (with reason):
It's strongly recommended that you (double- or single-) quote your strings! While the script engine is currently still permissive with unquoted strings (msg Hi! works) this might not be so in the future, so you better do msg "Hi!" right away!
Help / Advanced topics / Scripting / General Command Syntax / Using Quotes in Scripting
(Having written this pointer to the place in help I remember why I don't like the way help is organized. Sorry, Don...)
But your string starts and ends with ( and ), not being in quotes. And then both () are stripped in the next line...
(I assume I know why you did it this way: the double quotes around the pathes.)
I think one possible coding would be:
Code: Select all
$text= "focus P1; goto ""$path1""; focus P2; goto ""$path2"";";
A less elegant version:
Code: Select all
$text= 'focus P1; goto "' . $path1 . '"; focus P2; goto "' . $path2 . '";';
(The blanks around the dots are only for readability and have no meaning.)
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Folder/File pairs
@PeterH:
Thanks for pointing that out, I wrote that script in haste, but it works and I tested it before posting, so it was not that dangerous i think (and there is no delete involved).
I did fix it myself on my side later but never posted it as I was at work. Thanks again for that little reminder on how to quote
.
Just fixed the previous script.
Thanks for pointing that out, I wrote that script in haste, but it works and I tested it before posting, so it was not that dangerous i think (and there is no delete involved).
I did fix it myself on my side later but never posted it as I was at work. Thanks again for that little reminder on how to quote
Just fixed the previous script.
Re: Folder/File pairs
Thanks for the help. It works as intended and is a great improvement.
another question:
Is it possible to modify this script so that the pane paths to be saved are picked off the currently displayed panes. In other words: "I am already displaying the paths that I want to save, why go through the selection again?"
Thanks.
another question:
Is it possible to modify this script so that the pane paths to be saved are picked off the currently displayed panes. In other words: "I am already displaying the paths that I want to save, why go through the selection again?"
Thanks.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Folder/File pairs
That's just one line then.Slowfox wrote:Thanks for the help. It works as intended and is a great improvement.
another question:
Is it possible to modify this script so that the pane paths to be saved are picked off the currently displayed panes. In other words: "I am already displaying the paths that I want to save, why go through the selection again?"
Thanks.
Simply run below script and paste in Catalog's location field.
Code: Select all
//Copy paths of both panes to clipboard
copytext "focus P1; goto ""<get path 1>""; focus P2; goto ""<get path 2>"";";
XYplorer Beta Club