Page 1 of 1
Is there a way to have tag collections I could switch between?
Posted: 07 Nov 2022 01:20
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?
Re: Is there a way to have tag collections I could switch between?
Posted: 07 Nov 2022 05:21
by highend
There is taglist() so you could switch between whatever you'd like to script with it
Re: Is there a way to have tag collections I could switch between?
Posted: 07 Nov 2022 15:45
by admin
Also look at tagload().
Re: Is there a way to have tag collections I could switch between?
Posted: 07 Nov 2022 16:04
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

(
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?
Re: Is there a way to have tag collections I could switch between?
Posted: 07 Nov 2022 16:58
by highend
And you are free to implement that as well.
Custom Event Actions - Other Events - Exit -> Run script...
Re: Is there a way to have tag collections I could switch between?
Posted: 07 Nov 2022 17:16
by o7blue
Awesome, thanks for pointing the way
I'll post what I come up with later when I get around to writing it.
Re: Is there a way to have tag collections I could switch between?
Posted: 08 Nov 2022 11:21
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");
Re: Is there a way to have tag collections I could switch between?
Posted: 08 Nov 2022 11:37
by highend
Take a look at ctbicon() for icon changes on the toolbar
Re: Is there a way to have tag collections I could switch between?
Posted: 10 Nov 2022 04:32
by o7blue
I ended up using ctbstate() like so:
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.