Function ID for 'Find by Tags'?
Function ID for 'Find by Tags'?
Hi there, There Function IDs for Add/Set/Remove Tags but there doesn't appear to be one for Find by Tags. Am I missing something? Could a Function ID be added or what script commands would I use? Using Help I have this:
goto "C:\my path?tag:*";
It returns all the tagged files within the specified location but I can't figure out what commands I then need to make it search for particular tags, or invoke the Find by Tags Tag List ("Tick the tags that shall be matched").
goto "C:\my path?tag:*";
It returns all the tagged files within the specified location but I can't figure out what commands I then need to make it search for particular tags, or invoke the Find by Tags Tag List ("Tick the tags that shall be matched").
Windows 10 Pro 22H2
Re: Function ID for 'Find by Tags'?
I'm still struggling with this.
Is this just a type of search that I can store a template to? I can't figure out how to do that, though.
I thought I could use selfilter. It will, of course, work on the Tags [column] but I can't make it work using a variable for the [pattern]. Can this be done?
Or am I way off base either way? What I want to do is invoke the tag list as it appears when:
1. Selecting 'Tag List ...' in the 'Find by Tags' button dropdown.
or
2. Clicking the 'Select Tags ...' button in the Info Panel 'Find Files/Tags'.
Is this just a type of search that I can store a template to? I can't figure out how to do that, though.
I thought I could use selfilter. It will, of course, work on the Tags [column] but I can't make it work using a variable for the [pattern]. Can this be done?
Or am I way off base either way? What I want to do is invoke the tag list as it appears when:
1. Selecting 'Tag List ...' in the 'Find by Tags' button dropdown.
or
2. Clicking the 'Select Tags ...' button in the Info Panel 'Find Files/Tags'.
Windows 10 Pro 22H2
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Function ID for 'Find by Tags'?
Maybe something like this will work for you:
Code: Select all
$input=inputselect (TagList, getkey ("TagsList", "Settings"),",",2);
$input=replace($input, ",", "|");
$menu= popupmenu ("Current Folder|Everywhere");
IF($menu==Current Folder){
goto "<curpath>?tags:"$input" /rv";
}
ELSEIF($menu==Everywhere){
goto "%computer%?tags:"$input" /rv";
}
ELSE{
end 1==1;
}
Re: Function ID for 'Find by Tags'?
Hi there, thanks very much for that. It's definitely a start - The Tag List appears, I select the Tag and press OK, Current Folder/Everywhere menu appears, but no results are returned for either the Current Folder or Everywhere.
EDIT: So, as in my previous post, it appears to be a problem with using a variable in the ?tags: command. The $input variable doesn't work but replacing $input with a tag name will get results.
EDIT: Oooh forgot to ask. What does /rv do?
EDIT: So, as in my previous post, it appears to be a problem with using a variable in the ?tags: command. The $input variable doesn't work but replacing $input with a tag name will get results.
EDIT: Oooh forgot to ask. What does /rv do?
Windows 10 Pro 22H2
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Function ID for 'Find by Tags'?
Hmmm don't know whats wrong, work here.kiwichick wrote:Hi there, thanks very much for that. It's definitely a start - The Tag List appears, I select the Tag and press OK, Current Folder/Everywhere menu appears, but no results are returned for either the Current Folder or Everywhere.
EDIT: So, as in my previous post, it appears to be a problem with using a variable in the ?tags: command. The $input variable doesn't work but replacing $input with a tag name will get results.
r= recurse subfolders.kiwichick wrote: EDIT: Oooh forgot to ask. What does /rv do?
v=verbatim i.e. will ignore wildcards like * and ?. useful if you have want to search tags which have * or ? in them. eg. "delete?" or "important*" will be searched verbatim.
Edit: see help>Main topics>find files and go to "Wildcards in Tags" section.
Re: Function ID for 'Find by Tags'?
Strange, the Tag List that appears when using your script is not the same Tag List that appears when calling it by any other means. And any Tags I add to files aren't being added to the list your script callsserendipity wrote:Hmmm don't know whats wrong, work here.
Ah, no wonder I couldn't find it - I wasn't looking in that part of the Help fileserendipity wrote:see help>Main topics>find files and go to "Wildcards in Tags" section.
Windows 10 Pro 22H2
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Function ID for 'Find by Tags'?
That's expected, my method directly reads taglist from xy's config file. Better would be to read the tags.dat file. I should have mentioned that before, sorry.kiwichick wrote:Strange, the Tag List that appears when using your script is not the same Tag List that appears when calling it by any other means. And any Tags I add to files aren't being added to the list your script callsserendipity wrote:Hmmm don't know whats wrong, work here.
The script was just to show that it can be done. I think there are some scripts around which read tags.dat directly.
Re: Function ID for 'Find by Tags'?
Ah that makes sense and absolutely explains similar behaviour with other tagging scripts I have. I'm getting them to read the Tags List and not the database. So the Tags List and tag.dat don't synchronize their entries. Interesting, I wondered why the Tag List didn't reflect the actual tags items have. But, that being said, I am looking for tags that appear in both the Tags List and in tag.dat entries (30,000 in some cases).serendipity wrote:my method directly reads taglist from xy's config file. Better would be to read the tags.dat file.
C:\database test\clipboard.txt|0|banana, soap, wheelbarrow||||
TagsList=1980, 1987, abacus, ABBA, auction, back, baggage, balance, balloon, bamboo, banana, bandaid, bank, barcode, battery
As you can see both contain the 'banana' tag but when I use your script and choose banana no results are found - searching Current Folder or Everywhere makes no difference.
Windows 10 Pro 22H2
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Function ID for 'Find by Tags'?
Can you try the script with step mode and paste the code here when you reach goto command?
Re: Function ID for 'Find by Tags'?
Yip, definitely not right. This is, again, selecting banana in the Tag List - and I can see banana in the Tag List when it appears in Step Mode's 'Current command (parsed and resolved)' panel.
If I edit the script replacing "$input" with "banana" results for banana are found and the command is resolved correctly:
Code: Select all
goto
"C;\databasetest?tags:"" /rv"
Code: Select all
goto
"C;\databasetest?tags:"banana" /rv"
Windows 10 Pro 22H2
Re: Function ID for 'Find by Tags'?
And, if it helps, on the "This view is empty" search tab, the "Copy Location Term" is:
C:\database test?tags:" banana" /rv
So where does the space between " and b come from because that seems to be the problem. If I do a Tag Search in the Info Panel for (space)banana I get no results, if I do banana I get results. And then the Copy Location Term is:
C:\database test
C:\database test?tags:" banana" /rv
So where does the space between " and b come from because that seems to be the problem. If I do a Tag Search in the Info Panel for (space)banana I get no results, if I do banana I get results. And then the Copy Location Term is:
C:\database test
Windows 10 Pro 22H2
Re: Function ID for 'Find by Tags'?
Go it!!!!
Your script has the separator as "," but it should be ", ".
Changed and running like a gem!!!! Woot woot, go me!!!
Code: Select all
$input=replace($input, ",", "|");
Changed and running like a gem!!!! Woot woot, go me!!!
Windows 10 Pro 22H2
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Function ID for 'Find by Tags'?
OK, added trim space now.
Code: Select all
$input=inputselect (TagList, getkey ("TagsList", "Settings"),",",2);
$input=replace($input, ",", "|");
$input= formatlist($input, "t");
$menu= popupmenu ("Current Folder|Everywhere");
IF($menu==Current Folder){
goto "<curpath>?tags:"$input" /rv";
}
ELSEIF($menu==Everywhere){
goto "%computer%?tags:"$input" /rv";
}
ELSE{
end 1==1;
}
Re: Function ID for 'Find by Tags'?
Awesome!!!! Thank you sooooooooo much
And I'd put the wrong line of code above with the missing space - it should have been the 'inputselect' line not the 'replace' one
And I'd put the wrong line of code above with the missing space - it should have been the 'inputselect' line not the 'replace' one
Windows 10 Pro 22H2
Re: Function ID for 'Find by Tags'?
Hi Don, Is there any chance you might consider adding Function IDs for the Find Tags features? Cheers
Windows 10 Pro 22H2