Changing Path on Catalog Items

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
TestMeister
Posts: 228
Joined: 04 Feb 2008 20:17

Changing Path on Catalog Items

Post by TestMeister »

I have come to heavily rely on the Catalog feature and have multiple Catalogs containing many items.
Due to my own lack of planning, carelessness etc, I periodically need to rename folders that comprise the item paths.
I them have to click through the properties of each item and correct each path.

Not an enormous problem but it keeps coming up for me so is there a way to do this more easily?

For example, when you select the option to "Manage Favorite Folders", in the lower left there is an edit option that opens all the favorites in a single editor making multiple changes a snap.

or perhaps a default path can be set and then referenced by a variable placed in the item path ?

Any suggestions much appreciated!

jupe
Posts: 3292
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Changing Path on Catalog Items

Post by jupe »

No there isn't mass editing of the catalog directly available, but there are a few workarounds: in the favorites you can use a path wildcard though and this works from the catalog too, that might help you depending on what part of the path you are renaming (it only works in the last component).

Lookup "Fuzzy Favorites" if you don't know what I am talking about, you can paste the following into the address bar for more info:

Code: Select all

::help "idh_menfav.htm";
Another option you have though would be to edit the items that might change regularly, and have something similar to this as a catalog item script:

for folders:

Code: Select all

	$name = "folder name";
	goto quicksearch("$name /l=1 /d", "e:\parent\folder");
files:

Code: Select all

	$name = "file name";
	goto quicksearch("$name /l=1 /f", "e:\parent\folder");
then the catalog item would self update when clicked, you would need to customize your catalog entries & their icons you would need to change to a static location through the caption field, that is if you want icons.

You could also, add your catalog items in List Management | Aliases, then in the catalog items, reference them like this <@path1>, then you could mass edit your items in List Management, like you wanted, if you only want to use this approach for the path, then reference like this

<@path1>\filename.ext

And then for example your entry in List Management | Aliases would look like this: path1=c:\some\path\that\changes
you can paste the following into the XY address bar for more information if you are interested:

Code: Select all

::help "idh_addressbar.htm#idh_alias";
then to get an icon to display using the same path you can use the alias in the caption icon too. eg. Path 1|<@path1>

Another option if to have all the items that change regularly in Favorites Folders\Files which lets you mass edit them through List Management, then just re-add the whole Favorites category with the new paths to the catalog and remove the old one, in 1 step.

TestMeister
Posts: 228
Joined: 04 Feb 2008 20:17

Re: Changing Path on Catalog Items

Post by TestMeister »

A lot of options and using a the wild card in the path could probably work.
Many thanks for all the tips!

jupe
Posts: 3292
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Changing Path on Catalog Items

Post by jupe »

Yes that is a great feature, for anyone else interested here is visual explanation:

https://www.xyplorer.com/release_13.50.php#FuzzyFav

Emre
Posts: 33
Joined: 17 Feb 2016 07:14

Re: Changing Path on Catalog Items

Post by Emre »

Hello, I need to wake this old thread because I need to change my catalog directory shortcuts, they are some folder or files on the server. Now the server IP has changed, and looks like I need to manually edit all of them.

I couldn't fully understand the suggested procedure above. Can I change the \\192.168.2.ABC to \\912.168.2.XYZ on all the catalog items?

Even if not possible, is there a way to define a named folder, so that in the future when this happens I just need to change the named folder definition. (I think I got similer vibe from the procedure above). Like:

Code: Select all

Server = \\192.168.2.ABC
and in catalog item:

Code: Select all

Folder shortcut = Server\Drawings
etc. Yeah when in XYplorer you happen to get ideas :)

Thanks.

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Changing Path on Catalog Items

Post by highend »

Can be done via scripting

Most relevant commands / functions are
catalogreport()
cataloglocation()
catalogload , "s";

E.g.:

Code: Select all

    $find    = "\\192.168.0.123";
    $replace = "\\192.168.0.124";

    // =========================
    $entries = catalogreport(,"{Index}<:>{Caption}<::>{Location}");
    $count   = 0;
    $changed = false;
    foreach($entry, $entries, <crlf>, "e") {
        $index = gettoken($entry, 1, "<:>", "t");
        $path  = gettoken($entry, 2, "<::>", "t");
        if (strpos($path, $find) != -1) {
            $count++;
            $changed = true;
            $newPath = replace($path, $find, $replace);
            cataloglocation($index, $newPath);
        }
    }
    if ($changed) {
        catalogload , "s";
        echo "Catalog changed [" . $count . " entrie(s)]";
    } else {
        echo "Catalog NOT changed!";
    }
One of my scripts helped you out? Please donate via Paypal

Emre
Posts: 33
Joined: 17 Feb 2016 07:14

Re: Changing Path on Catalog Items

Post by Emre »

Thanks alot @highend. I guess I'm too noob with XY scripting. I saved this as a script file, when I load it the lines in the script appear as clickable list in XY. I tried making a script catalog item, same result.

Do I need to add path for my catalog etc? Sorry for bothering you btw :), I'm reading info on them now to figure out myself.

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Changing Path on Catalog Items

Post by highend »

You did not indent the lines as they are in the code tags...
One of my scripts helped you out? Please donate via Paypal

Emre
Posts: 33
Joined: 17 Feb 2016 07:14

Re: Changing Path on Catalog Items

Post by Emre »

Omg it worked. I just needed to re-open the catalog because it closed it. Thanks for the help, I really need to learn this, this is so powerful.

EDIT: I just ran through all of your code step by step (by the help of manual and AI), I am much more amazed that such actions are possible in this program. Thanks for all the trouble @highend.

Post Reply