Is there a way to have tag collections I could switch between?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
o7blue
Posts: 143
Joined: 22 Dec 2020 07:10

Is there a way to have tag collections I could switch between?

Post by o7blue »

I'm getting to the point where I would like to switch between tag collections, that is to say having all the tags existing together at the same time is not good for me.

I have different firefox profiles, so when I open up a specific profile it gives me bookmarks for that profile. My second profile has its own bookmarks. They don't interfere with each other, and it makes everything cleaner and easier to manage.

Can I get something similar in XY? The only thing I can think of is manually moving the tags created in appdata and switching between the tag files as needed. Is there a better way though?
OS: Windows 10
DPI: 100%

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

Re: Is there a way to have tag collections I could switch between?

Post by highend »

There is taglist() so you could switch between whatever you'd like to script with it
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 67340
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Is there a way to have tag collections I could switch between?

Post by admin »

Also look at tagload().

o7blue
Posts: 143
Joined: 22 Dec 2020 07:10

Re: Is there a way to have tag collections I could switch between?

Post by o7blue »

Thanks highend, searching for that function brought up a thread from 6 years ago where someone asked an identical question which you answered :biggrin: (viewtopic.php?t=16562)

But after loading a tag cloud from a file, with that file get updated with any new tags when exiting XY? And the tagged locations would not be there, right? Tags are in XYplorer.ini while the tagged items are in tag.dat, right? And from what I can tell we're only touching the TagsList in XYplorer.ini, right?

Is it possible to add an export/save routine on XY exit that would update the currently loaded tag cloud? I think what would be most convenient for me, would be to add a couple custom buttons to the toolbar which would load different tag clouds. Then on exit, whatever changes I made would get exported out on close. Is that possible? That would require some persistent value for the tag location, right?
OS: Windows 10
DPI: 100%

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

Re: Is there a way to have tag collections I could switch between?

Post by highend »

And you are free to implement that as well.

Custom Event Actions - Other Events - Exit -> Run script...
One of my scripts helped you out? Please donate via Paypal

o7blue
Posts: 143
Joined: 22 Dec 2020 07:10

Re: Is there a way to have tag collections I could switch between?

Post by o7blue »

Awesome, thanks for pointing the way :tup:

I'll post what I come up with later when I get around to writing it.
OS: Windows 10
DPI: 100%

o7blue
Posts: 143
Joined: 22 Dec 2020 07:10

Re: Is there a way to have tag collections I could switch between?

Post by o7blue »

I think I got it. The only thing I couldn't figure out is how to have a button on the toolbar look pressed down. It would help in identifying which tag cloud I currently have selected.

As for my solution, I have two buttons on the toolbar that trigger "Load tag cloud 1.xys" and "Load tag cloud 2.xys". "Exit routing.xys" is triggered on exit.

Load tag cloud 1.xys:

Code: Select all

    load("<xyscripts>\tag cloud\Export Tag Cloud.xys");
    
    perm $tagCloudSelector = 1;
    tagload("<xyscripts>\tag cloud\tag db\db1.dat", 0);
    #893; // refresh tag list
Load tag cloud 2.xys:

Code: Select all

    load("<xyscripts>\tag cloud\Export Tag Cloud.xys");
    
    perm $tagCloudSelector = 2;
    tagload("<xyscripts>\tag cloud\tag db\db2.dat", 0);
    #893; // refresh tag list
Export Tag Cloud.xys:

Code: Select all

    #195; // save tags (prevents popup asking the same thing)
    
    if ($tagCloudSelector == 1) {
        tagexport("<xyscripts>\tag cloud\tag db\db1.dat", "", , );
    }
    elseif ($tagCloudSelector == 2) {
        tagexport("<xyscripts>\tag cloud\tag db\db2.dat", "", , );
    }
Exit routine.xys:

Code: Select all

    load("<xyscripts>\tag cloud\Export Tag Cloud.xys");
OS: Windows 10
DPI: 100%

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

Re: Is there a way to have tag collections I could switch between?

Post by highend »

Take a look at ctbicon() for icon changes on the toolbar
One of my scripts helped you out? Please donate via Paypal

o7blue
Posts: 143
Joined: 22 Dec 2020 07:10

Re: Is there a way to have tag collections I could switch between?

Post by o7blue »

I ended up using ctbstate() like so:

Code: Select all

    ctbstate(1, 4);
    ctbstate(0, 5);
Then just the inverse for the second button.

Thank you Don and highend for the help, I think this is all the functionality I wanted.
OS: Windows 10
DPI: 100%

Post Reply