Page 1 of 2

adding comments and then trying to do a search doesnt work

Posted: 15 Nov 2009 19:43
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!!

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

Posted: 15 Nov 2009 20:16
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)

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

Posted: 16 Nov 2009 12:12
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.

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

Posted: 16 Nov 2009 16:53
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;

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

Posted: 16 Nov 2009 17:15
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?

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

Posted: 16 Nov 2009 17:32
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?

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

Posted: 16 Nov 2009 17:37
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.)

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

Posted: 16 Nov 2009 17:52
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,'[','[[]'),'#','[#]') ?

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

Posted: 16 Nov 2009 17:53
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

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

Posted: 16 Nov 2009 18:01
by TheQwerty
Why not use Report?

Code: Select all

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

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

Posted: 16 Nov 2009 18:24
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!

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

Posted: 16 Nov 2009 18:25
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;

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

Posted: 16 Nov 2009 18:39
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.

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

Posted: 16 Nov 2009 18:43
by admin
Luckily the next version will support searching for comments natively... :wink: :mrgreen:

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

Posted: 16 Nov 2009 21:12
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.