Catalog Switcher

Discuss and share scripts and script files...
Post Reply
serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Catalog Switcher

Post by serendipity »

SCRIPT OUTDATED
Multiple catalogs is implemented since 9.90.0700.

I made a simple catalog switcher which lets you use as many catalogs as you want. This is especially useful if you have XY on USB and you use it on more than one PC. Its also useful if you want to have more than one catalog for whatever reason.

WARNING!! Please backup of your XY before trying this.

How it works:

1. Make a duplicate of your current catalog and rename it to anything you like. In my script i have it catalogOriginal.dat.

2. Make an ini file and put "catalogOriginal.dat" as a value for a key. My ini file looks like this:

Code: Select all

[Catalog]
inuse=catalogOriginal.dat
3. Now create more catalogs. I have 3: catalogFiles.dat, catalogApps.dat, catalogScripts.dat.
Easiest way to do this is to:
(a) Save settings: menu "File>Settings>Save all settings".
(b) Make another copy of your catalog.dat and name it say catalogApps.dat.
(c) Select catalogApps.dat and catalog.dat and use menu "File>Swap names".
(d) Now, "File>Restart without saving"
(e) Change the catalog the way you want it, like removing every item except applications.
(f) same as (a).
(g) same as (c).
(h) same as (d).

You have now created a new catalog called catalogApps.dat which will have only the applications. Similarly you can make more catalogs. I have three catalogs plus the original one.

4. Now the script:

Code: Select all


"&1. Catalog Files"
   set $cat, "catalog.dat";
   set $new, "catalogFiles.dat";
   goto <xypath>;
 // Save all settings
   #182;
 // Get old catalog name from cat.ini
   getkey $old, inuse, catalog, "<xypath>\Scripts\cat.ini";
   focus;
   selfilter "$cat;$old";
 //Swap filenames with old catalog
   swapnames;
   focus;
   selfilter "$cat;$new";
 // swap filenames with new catalog
   swapnames;
 // Set new catalog name to cat.ini
   setkey "$new", inuse, catalog, "<xypath>\Scripts\cat.ini";
 //restart without saving
   #190;
- 

"&2. Catalog Scripts"
   set $cat, "catalog.dat";
   set $new, "catalogScripts.dat";
   goto <xypath>;
   #182;
   getkey $old, inuse, catalog, "<xypath>\Scripts\cat.ini";
   focus;
   selfilter "$cat;$old";
   swapnames;
   focus;
   selfilter "$cat;$new";
   swapnames;
   setkey "$new", inuse, catalog, "<xypath>\Scripts\cat.ini";
   #190;
- 

"&3. Catalog Apps"
   set $cat, "catalog.dat";
   set $new, "catalogApps.dat";
   goto <xypath>;
   #182;
   getkey $old, inuse, catalog, "<xypath>\Scripts\cat.ini";
   focus;
   selfilter "$cat;$old";
   swapnames;
   focus;
   selfilter "$cat;$new";
   swapnames;
   setkey "$new", inuse, catalog, "<xypath>\Scripts\cat.ini";
   #190;
-
 
"&4. Catalog Original"
   set $cat, "catalog.dat";
   set $new, "catalogOriginal.dat";
   goto <xypath>;
   #182;
   getkey $old, inuse, catalog, "<xypath>\Scripts\cat.ini";
   focus;
   selfilter "$cat;$old";
   swapnames;
   focus;
   selfilter "$cat;$new";
   swapnames;
   setkey "$new", inuse, catalog, "<xypath>\Scripts\cat.ini";
   #190;
  
 
Ofcourse, if you have only two catalogs then you can do with a simpler script. Select the two catalogs and use this:

Code: Select all

//Save settings
   #182;
   focus;
   swapnames;
//Restart without saving
   #190;
Again, backup XY before trying this.

5th Sept 2008: Updated to work with new syntax

Post Reply