adding comments and then trying to do a search doesnt work

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
little titty
Posts: 81
Joined: 15 Nov 2009 19:34

adding comments and then trying to do a search doesnt work

Post by little titty »

What am I doing wrong? (using xy 8.6)
I have a folder open of photos
I select a few and add a comment by choosing Favourites\comment (this is because I dont like just colored tags, wish there was a way of tagging with a name)
eg I add the comment, orange cow
now if I bring up the info pane and try a search by typing in orange cow it finds nothing.
Is the comment not being added to the images or am i not searching correctly?

I think this could be a useful program to use with images if I could figure out how to use it!!
Why doesn't everybody have a great user name like mine?

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

Re: adding comments and then trying to do a search doesnt work

Post by admin »

Hello,

Searching comments is not yet implemented. It's planned ever since there are comments, but other things came in the way. It's on my list under the heading VFO (Virtual Folders) because that's how it's planned to work.

Don (author)

little titty
Posts: 81
Joined: 15 Nov 2009 19:34

Re: adding comments and then trying to do a search doesnt work

Post by little titty »

Pity, I will continue to use a separate program to view/sort/tag my pix . I hope one day to find an xplorer like programm that can do that also, so that an extra program would not be necessary.
Why doesn't everybody have a great user name like mine?

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: adding comments and then trying to do a search doesnt work

Post by serendipity »

But one can use scripting to search comments:
Something like this:

Code: Select all

//Search comments
   $search = input ("Search Comments", "What comments are you searching for?", "orange cow");
//Show all items in branch
   #263;
//Select all searched comments
   selfilter $search,,comment;
//Get the names of the searched comments
   $files = getinfo ("SelectedItemsNames", """ | """);
   $files = substr ($files, 0,-1);
   $files="""$files";
//show only searched comments
   filter $files;
Last edited by serendipity on 16 Nov 2009 17:32, edited 1 time in total.

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

Re: adding comments and then trying to do a search doesnt work

Post by admin »

serendipity wrote:But one can use scripting to search comments:
Something like this:

Code: Select all

//Search comments
   $search = input ("Search Comments", "What comments are you searching for?", "orange cow");
//Show all items in branch
   #263;
//Select all searched comments
   selfilter $search,,comment;
//Get the names of the searched comments
   $files = getinfo ("SelectedItemsNames", """ | """);
   substr $files, $files, 0,-1;
   $files="""$files";
//show only searched comments
   filter $files;
I admit I don't do much scripting but 2 things:
(1) substr() is a function in recent version, not a statement
(2)

Code: Select all

$files="""$files";
??? what's the idea here?

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: adding comments and then trying to do a search doesnt work

Post by serendipity »

admin wrote:
serendipity wrote:But one can use scripting to search comments:
Something like this:

Code: Select all

//Search comments
   $search = input ("Search Comments", "What comments are you searching for?", "orange cow");
//Show all items in branch
   #263;
//Select all searched comments
   selfilter $search,,comment;
//Get the names of the searched comments
   $files = getinfo ("SelectedItemsNames", """ | """);
   substr $files, $files, 0,-1;
   $files="""$files";
//show only searched comments
   filter $files;
I admit I don't do much scripting but 2 things:
(1) substr() is a function in recent version, not a statement
Yup I am still stuck with the statement thing, i will change that.
admin wrote: (2)

Code: Select all

$files="""$files";
??? what's the idea here?
I am sure there is a better way, but I just went with what works. I simply want to add one single " in front of the previous string. I could use chr (34); but the above works too. Is there a way to add a single " to your strings?

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

Re: adding comments and then trying to do a search doesnt work

Post by admin »

serendipity wrote:
admin wrote: (2)

Code: Select all

$files="""$files";
??? what's the idea here?
I am sure there is a better way, but I just went with what works. I simply want to add one single " in front of the previous string. I could use chr (34); but the above works too. Is there a way to add a single " to your strings?
No, your way is ok. But why add one single "? (Sorry in advance for my blackout.)

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: adding comments and then trying to do a search doesnt work

Post by jacky »

admin wrote:No, your way is ok. But why add one single "? (Sorry in advance for my blackout.)
Cause he's using a VF. The single quote is there to use an exact match pattern, i.e. disabling "loose match" -- Although I'm not sure that's enough, one might have also to also escape such characters as [ or #, so adding something like replace(replace($files,'[','[[]'),'#','[#]') ?
Proud XYplorer Fanatic

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: adding comments and then trying to do a search doesnt work

Post by serendipity »

admin wrote:
serendipity wrote:
admin wrote: (2)

Code: Select all

$files="""$files";
??? what's the idea here?
I am sure there is a better way, but I just went with what works. I simply want to add one single " in front of the previous string. I could use chr (34); but the above works too. Is there a way to add a single " to your strings?
No, your way is ok. But why add one single "? (Sorry in advance for my blackout.)
The idea is to quote each selected file name. I could simply use this:

Code: Select all

$files = getinfo ("SelectedItemsNames", "|");
filter "$files";
which does filter the selected files, but that will not distinguish between two similar file names:
filter "search"; is better than filter search; because in the latter case even searchall, searchweb will get filtered too.

Instead I use:
$files = getinfo ("SelectedItemsNames", """ | """); // which adds quotes to every file name but adds double quotes at the end and no quote in the beginning
substr $files, $files, 0,-1; //removes extra quote from end
$files="""$files"; //adds one quote to the beginning

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: adding comments and then trying to do a search doesnt work

Post by TheQwerty »

Why not use Report?

Code: Select all

$files=Report('"{Name}"|',1);
EDIT: Forgot the pipe.

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: adding comments and then trying to do a search doesnt work

Post by serendipity »

TheQwerty wrote:Why not use Report?

Code: Select all

$files=Report('"{Name}"|',1);
EDIT: Forgot the pipe.
:oops:, see!! it was right there and I never bothered to see it. Thanks TheQwerty!

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: adding comments and then trying to do a search doesnt work

Post by serendipity »

So the newer script is:

Code: Select all

//Search comments
   $search = input ("Search Comments", "What comments are you searching for?", "orange cow");
//Show all items in branch
   #263;
//Select all searched comments
   selfilter $search,,comment;
//Get the names of the searched comments
   $files=Report('"{Name}"|',1);
//show only searched comments
   filter $files;

Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: adding comments and then trying to do a search doesnt work

Post by Muroph »

serendipity wrote:So the newer script is
you forgot this:
jacky wrote:one might have also to also escape such characters as [ or #, so adding something like replace(replace($files,'[','[[]'),'#','[#]')
dunno about other people, but a huge number of my files have "[...]" in their names, making this a very important step.
you should add it before "filter" and maybe even "selfilter" in that script.
Last edited by Muroph on 16 Nov 2009 18:43, edited 1 time in total.
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

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

Re: adding comments and then trying to do a search doesnt work

Post by admin »

Luckily the next version will support searching for comments natively... :wink: :mrgreen:

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

Re: adding comments and then trying to do a search doesnt work

Post by admin »

little titty wrote:What am I doing wrong? (using xy 8.6)
I have a folder open of photos
I select a few and add a comment by choosing Favourites\comment (this is because I dont like just colored tags, wish there was a way of tagging with a name)
eg I add the comment, orange cow
now if I bring up the info pane and try a search by typing in orange cow it finds nothing.
Is the comment not being added to the images or am i not searching correctly?

I think this could be a useful program to use with images if I could figure out how to use it!!
OK, you ask, I deliver. :mrgreen:

Enter this in the Name field on the Find Files tab:
comment:orange cow
Should find all items with comment "orange cow" in the current folder.

Post Reply