Can you search within a bookmark from the command line?

General discussion related to "Everything".
Post Reply
otravers
Posts: 5
Joined: Tue May 31, 2016 6:30 pm

Can you search within a bookmark from the command line?

Post by otravers »

Hi,

I've set up a bookmark to show only the ebooks within a specific folder, excluding other files and folders from the results. So far so good. But I'd like to combine it with additional search/filter parameters from the command line so that I can search *within* the bookmark with one Launchy instruction (the program I use to invoke Everything through its CLI).

Is that possible? I've tried it but it seems my -s or -filter parameters are ignored and I just get the bookmark results without the additional parameters. Thanks for any help!
NotNull
Posts: 5252
Joined: Wed May 24, 2017 9:22 pm

Re: Can you search within a bookmark from the command line?

Post by NotNull »

Yes, you can combine bookmarks and filters. For example, this will find my Scandinavian, French and German music:
Everything.exe -filter Audio -bookmark "Non-ascii names"


Remarks:
  • When you configure a bookmark, you can also select a filter to use. That filter will overrule teh one you configure on the command-line.
    So make sure Remember filter: is unchecked
  • When your filter and/or bookmark contains spaces, enclose it in double quotes (see example)
  • When combining a bookmark and a -s search, the -s search will be ignored (the bookmark defines what to search for)
otravers
Posts: 5
Joined: Tue May 31, 2016 6:30 pm

Re: Can you search within a bookmark from the command line?

Post by otravers »

Thanks for your answer. In this case, maybe bookmarks are not the best way to accomplish what I'm after. Here's what I'm trying to accomplish:

1. I want to scope my search to a specific path and a specific set of file extensions, like so:

Code: Select all

"D:\Ebooks\" file: *.pdf|*.epub|*.mobi|*.azw*
2. I want results to show only files, not folders.

3. I want to be able to add keywords to that query (i.e. search books by title/author as both are in my file names).

All of the above is achievable with a bookmark, but it sounds like #3 has to be typed in the Everything search box after invoking it from the command line.

Instead I'd like to have a command line search syntax that combines my requirements: specific path + specific extensions + excluding folders from results + search keywords. This would be a very seamless user experience from Launchy as I'd have to type my query just once, as opposed to invoke the bookmark then type my keywords. Thoughts?
NotNull
Posts: 5252
Joined: Wed May 24, 2017 9:22 pm

Re: Can you search within a bookmark from the command line?

Post by NotNull »

otravers wrote: Fri Mar 26, 2021 8:20 pmThoughts?
A lot of thoughts :)

Let's get this clear, before posting irrelevant thoughts:

In Launchy you want to type
homerus ilias
or
ilias
or
homerus
and then press a button (?) and that would open Everything with a search for all *.pdf, *.epub, *.mobi and *.azw* files in the folder d:\ebooks (or subfolders thereof) containing the words homerus and ilias in their name?
otravers
Posts: 5
Joined: Tue May 31, 2016 6:30 pm

Re: Can you search within a bookmark from the command line?

Post by otravers »

NotNull wrote: Fri Mar 26, 2021 8:33 pmIn Launchy you want to type
homerus ilias
or
ilias
or
homerus
and then press a button (?) and that would open Everything with a search for all *.pdf, *.epub, *.mobi and *.azw* files in the folder d:\ebooks (or subfolders thereof) containing the words homerus and ilias in their name?
That's exactly it! Well, save for the part where I'd just hit Enter instead of clicking a button to launch the CLI query from Launchy, but that's an irrelevant detail.
NotNull
Posts: 5252
Joined: Wed May 24, 2017 9:22 pm

Re: Can you search within a bookmark from the command line?

Post by NotNull »

OK, in the meantime I dusted off Launchy - a years old version was still in a corner on my drive - and tested it.

Works here with:

Name = ebook
Program = C:\Path To\Everything.exe
Arguments =
-search " """d:\ebooks""" ext:pdf;epub;mobi;azw file: $$"



If you create a filter in Everything called "ebook" ( search =
"d:\ebooks" ext:pdf;epub;mobi;azw file:
), you can simplify things in Launchy:

Arguments = -filter ebook -search "$$"



For others reading this:
In Launchy, type ebook, followed by pressing the TAB key, followed by homerus and press ENTER.
That will open the search in Everything.



Note:
the file: is probably not needed as you probably don't have many folders with a .pdf extension ...
otravers
Posts: 5
Joined: Tue May 31, 2016 6:30 pm

Re: Can you search within a bookmark from the command line?

Post by otravers »

Thank you so much, this works perfectly!
Post Reply