Option to monitor clipboard

Have a suggestion for "Everything"? Please post it here.
Post Reply
DCT
Posts: 3
Joined: Sat Oct 07, 2017 11:25 pm

Option to monitor clipboard

Post by DCT »

It is usual task to make some searches by pasting from clipboard. So sometimes it could be convenient to auto place clipboard text to the search field (and to quickly enable/disable this option).
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

That link is broken.

I am using 1.5 alpha, but it is not clear whether this feature is added in it.
I have set a global hotkey of CTRL+SpaceBar, because it is simple to search for the desired text with a 3-step process:

1. select text from anywhere, and press CTRL+C to copy the text to clipboard.
2. press CTRL+SpaceBar to launch Everything'
3. press CTRL+V to paste the text in the search bar of Everything.
(I don't have to press Enter, as I have activated the "search as you type" optional feature.)

This relatively ok, because the CTRL key is common in all three hotkeys, and the other keys (C, SpaceBar and V) are located close to each other.
Thus it is possible to develop muscle memory, and hit the three hotkeys rapidly.

But if Everything can monitor the clipboard, it can accomplish the task with just two hotkeys.
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: Option to monitor clipboard

Post by void »

To search with the clipboard contents in Everything 1.5:
  • In Everything 1.5, type in the following search:
    #clipboard:
    -or-
    clipboard:
Spaces are quoted with clipboard:

#clipboard:
clipboard:
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

Thanks for the prompt reply!

I tried both tokens (clipboard: and #clipboard:) one at a time, but they do not work for me at all.

Here is the complete procedure I followed. Am I doing something wrong?

1. I selected a file in my Windows Explorer, and copied its name on the clipboard.
2. I pressed CTRL+SpaceBar to launch Everything
3. I pressed SHFT+CTRL+V to enter the file name in the search bar. The file appears in the search results.

(These first three steps just confirm that the experiment is set up correctly.)

4. I cleared the search bar contents and then typed clipboard: but the file name did not appear in the results pane.

5. I added a hash in front to change the search to #clipboard: but again the file name did not appear in the results pane.

6. I cleared the search bar, and again pressed SHFT+CTRL+V and found the file.
(This step was just to confirm that the clipboard content is not changed somehow.)

Thus, neither token works in 1.5 Alpha.

**********
BTW it is too tedious to type any of these two tokens!
My three-step process is far shorter and uses muscle memory (as compared to typing specific text).
So there is no efficiency advantage achieved by using this token, even if it worked.

To conclude, the best efficiency can be achieved if Everything monitors the clipboard, rather than having to enter any tokens.

In fact, I would like to take this idea one step further: Can we just select the text anywhere and press a global hotkey (say SHFT+CTRL+SpaceBar) to launch Everything and place the selected text in its search bar?

(Let the user launch Everything with the selected text as argument.)

In other words, we should be able to search for the selected text with a single hotkey!
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: Option to monitor clipboard

Post by void »

clipboard: will be replaced with the text from the clipboard with spaces and special characters quoted.
#clipboard: will be replaced with the text from the clipboard as is.

Everything is probably not matching the filename on the clipboard correctly.
Could you please try searching for:
clipboard:

Then copying something simple to the clipboard, for example:

A

Does Everything find files containing A?

If so, try copying B to the clipboard, does Everything detect the change to your clipboard and find files containing B?
-Maybe Everything is having trouble detecting changes to the clipboard?



To see what Everything is replacing #clipboard: with:
  • Copy and paste the following into your Everything search box:
    /#clipboard:
    (Copy a file or filename to the clipboard)
  • Press ENTER in your Everything search box.
  • The search should be replaced with the contents of the clipboard.


Do you have any search options enabled under the Search menu?


BTW it is too tedious to type any of these two tokens!
Yes, please consider the following command line call:
Everything.exe -s """#clipboard:"""

If you don't want to quote the clipboard text, please use:
Everything.exe -s #clipboard:



If you are using an Everything hotkey under Tools -> Options -> Keyboard, please consider setting your tray_show_command_line:
  • Copy and paste the following into your Everything search box:
    /tray_show_command_line=-s "#clipboard:"
  • Press ENTER in your Everything search box.
  • If successful, tray_show_command_line=-s "#clipboard:" shown in the status bar for a few seconds.
Everything will now set your search to the text on the clipboard when pressing your Everything hotkey.



Everything -s
tray_show_command_line
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

That was almost what I wanted, and yet not quite so!

I followed your advice as follows:

1. copied /#clipboard: and pasted it in Everything's search bar.
2. Switched to this page and copied the letter A to clipboard.
3. Switched to Everything and pressed Enter.

Immediately Everything replaced the token with A and listed a large number of files.

So far so good.

But here's the catch: Now the search bar contains A and not /#clipboard:!
So if I switch back to browser and copy B, I cannot use Everything to find B.

Thus the very purpose of using the token is lost.

In fact, I had the hopes of using the browser and Everything in a split-screen format (side by side), and go on copying different texts from the browser (on the left) and glance at Everything (on the right) to check if any file matching that is found!

Naturally that logic will work only if-
1. Everything does not physically convert the token into a hard-coded string, but uses the value stored in the clipbaord.
2. Everything does not require the user to press ENTER each time.

In other words, I expected Everything to work in a mode that is similar to "find as you type" mode.
But here, instead of typing each search string, we are simply passing a new string to Everything via the clipboard.
So it should go on reflecting the latest content of the clipboard.

*****
About passing selected text to Everything without using clipboard:


A software called WordWeb can be used like what I requested: You simply select some text and press its hotkey.
The WordWeb GUI pops up, and shows the dictionary meaning of the selected text. You do NOT need to copy the string onto the clipboard at all.

So logically you should be able to use the same trick to invoke Everything.
Once launched, Everything should show the search results without having to press Enter ("Search as you type" feature)
froggie
Posts: 300
Joined: Wed Jun 12, 2013 10:43 pm

Re: Option to monitor clipboard

Post by froggie »

In fact, I had the hopes of using the browser and Everything in a split-screen format (side by side), and go on copying different texts from the browser (on the left) and glance at Everything (on the right) to check if any file matching that is found!
1. Just open Everything and type #clipboard: into the search bar (without a "/")

2. Now copy an "A" onto the clipboard

That should search for "A" in Everything and show a list of files. - It will still show the #clipboard: in the search bar and if you now copy a "B" to the clipboard, Everything will search for "B".
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

I tried this and it works beautifully!

(If we press Enter, the token is replaced by the content of the clipboard, which defeats the whole purpose of using the token. So NOT pressing Enter made all the difference!)

I arranged my browser and Everything in a split-screen mode (side by side) and went on selecting various strings in the browser. Everything instantly showed me the matching items.

This is as efficient as we can get: It finishes the task with just one hotkey!
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

If you are using an Everything hotkey under Tools -> Options -> Keyboard, please consider setting your tray_show_command_line:
  • Copy and paste the following into your Everything search box:
    /tray_show_command_line=-s "#clipboard:"
  • Press ENTER in your Everything search box.
  • If successful, tray_show_command_line=-s "#clipboard:" shown in the status bar for a few seconds.
Everything will now set your search to the text on the clipboard when pressing your Everything hotkey.
I followed this, and it saves me one hotkey (I still have to use CTRL+C and CTRL+SpaceBar, but I don't have to press CTRL+V or SHFT+CTRL+V).

So all in all, the /#clipboard: token suits my workflow the best, as it reduces the whole effort to just one hotkey. (For me, the split-screen method is the best solution for rapidly checking out a large number of files. If the file does not exist in my collection, I click on the link to download it and move on to the next file. This workflow is amazingly efficient with Google Scholar, for example.)

Thanks for the tips!
froggie
Posts: 300
Joined: Wed Jun 12, 2013 10:43 pm

Re: Option to monitor clipboard

Post by froggie »

You should not use the "/" - just #clipboard: or clipboard: on the search line, which will not be altered if you happen to press enter.
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

oops! That was a typo: I had actually entered it without slash, just as you had advised.

BTW I would like to know the significance of the two additional modifiers (# and /).
How do they alter the function of the token, when they are added individually or together?

I went through the help (especially this page), but could not find the basic explanation of how tokens are composed (their syntax). I also looked for a master list of tokens (an appendix or something), but could not find it.

Ideally, the help doc should have a separate chapter on "Everything about tokens":
1. How to use a token
2. How to compose a token
3. How the modifiers (#, /, etc) alter their basic function

This might be obvious to programmers, but non-programmers would need such basic tips to be able to exploit Everything to the hilt!

It would be great to have another help chapter that compiles user-contributed use cases (efficient workflows).
froggie
Posts: 300
Joined: Wed Jun 12, 2013 10:43 pm

Re: Option to monitor clipboard

Post by froggie »

The information is in the top of the Search Preprocessor section -- viewtopic.php?f=12&t=10099

Your specific questions are answered by:
Function names starting with a # will not automatically quote search terms.
For example:
#upper:"abc 123" => ABC 123
upper:"abc 123" => "ABC 123"
and
If the search starts with /function: and ENTER is pressed, the search will be replaced with the expanded preprocessor text.
For example, typing in the search /len:abc and pressing ENTER will replace the search with 3.
Not always that easy to find, but this is an Alpha release. This forum is immensely helpful - I do not think I have seen a question where the helpful people here did not provide assistance.
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

This forum is immensely helpful.
My thoughts, exactly! :)
therube
Posts: 4953
Joined: Thu Sep 03, 2009 6:48 pm

Re: Option to monitor clipboard

Post by therube »

Since you can do something like:
everything.exe -instance 15 -s #clipboard:
,
if you set up an (oh, I don't know what - auto hotkey, maybe ?) that runs a command line such as above...
Heh. Guess I'm late. I see void said just that.
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

I faced two unexpected glitches after using the #clipboard: token:

1. When we are using the #clipboard: token, Everything cannot ignore punctuation.
In other words, if the selected text contains punctuation, this trick will not work.
So I will have to revert to my three step-method (CTRL+C, CTRL+SpaceBar, SHFT+CTRL+V).

2. But here's the second problem: I am unable to get rid of the #clipboard: token!
I cleared out the search bar and entered a string manually.
From that point onward, I expected Everything to stop using the #clipboard: token.
But if I press CTRL+C and press CTRL+SpaceBar, Everything shows me the results for that selection directly.
It does not allow me to press SHFT+CTRL+V, which means I have to manually clean up punctuations from the search string.
Last edited by Raindrops on Tue Jan 24, 2023 6:29 pm, edited 1 time in total.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Option to monitor clipboard

Post by NotNull »

[quote=Raindrops post_id=52669 time=1674575754 user_id=39752
1. When we are using the #clipboard: token, Everything cannot ignore punctuation.
[/quote]
That will soon be possibvle:
void wrote: Sun Jan 22, 2023 5:18 am I'll have an option in the next alpha update to ignore punctuation when pasting text in the search box.
For now, please use: Ctrl + Shift + V
For now, there is some sort of workaround:

- Paste the following in Everything's search bar:

Code: Select all

#regex-replace:<#replace:<#replace:<#clipboard:,[, >,], >,[_\.\-\(\)\{\}]," ">
- add some text to the clipboard
- see results in Everything
- If success, make it a bookmark for future use

(just superficially tested and not all special characters are stripped. Let me know which ones you miss)
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

Is that workaround to clear the #clipboard: token?

I pasted your code in Everything's search bar. Since you had not asked me to press Enter, I did not press Enter.
Then I switched back to the browser and copied a text on clipboard.
I switched back to Everything with ALT+Tab (did not use CTRL+SpaceBar to prevent the token from acting up once again).
I found that Everything continued showing your code (instead of the new content of the clipboard).

But if I copy something to the clipboard and then press CTRL+SpaceBar, Everything shows that text in its search bar.

************
I was not sure how your code is supposed to work.
So I conducted a second experiment, in which I pressed Enter after pasting your code in the search bar.
The rest of the steps were the same.

But in this case also, the results are the same.

To sum up, the #clipboard: token refuses to stop working! :(
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Option to monitor clipboard

Post by NotNull »

Raindrops wrote: Tue Jan 24, 2023 6:39 pm Is that workaround to clear the #clipboard: token?
Yes, it should strip some problematic characters automatically. The search text will not change.
Do not press ENTER.


Second attempt:
- paste the search in the Everything search bar

Code: Select all

#regex-replace:<#replace:<#replace:<#clipboard:,[, >,], >,[_\.\-\(\)\{\}]," ">
- copy the following text to the clipboard

Code: Select all

every(thing).exe
- switch back to Everything (ALT + TAB)
- The search should still be the same, but results should show all files/folders containing ever and thing and exe

- copy the following text to the clipboard

Code: Select all

note_pad.exe
- switch back to Everything (ALT + TAB)
- The search should still be the same, but results should show all files/folders containing note and pad and exe


Do you get different results?
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

Nope!

Neither of the strings produced any results. The result panel is blank.

The address bar shows your code, and is not replaced by the content of the clipboard.
(I do understand that this is only to be expected, because I am using the token in RegEx, not in raw form.)

But the point remains: Once this token is used, how do we go back to the "factory-set" (default) version of Everything?
This is a strange problem! Why should a token be sticky like that??
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: Option to monitor clipboard

Post by void »

Please try the following search:

#regex-replace:<#clipboard:,"[`~!@#$%^&*()\-=_+{}|\[\]\\;':,./<>?"#quot:"]"," ">


But the point remains: Once this token is used, how do we go back to the "factory-set" (default) version of Everything?
This is a strange problem! Why should a token be sticky like that??
Please try clearing your tray_show_command_line:
  • Copy and paste the following into your Everything search box:
    /tray_show_command_line=
  • Press ENTER in your Everything search box.
  • If successful, tray_show_command_line= is shown in the status bar for a few seconds.


If you want your hotkey to set the search without expansion to exactly:

#regex-replace:<#clipboard:,"[`~!@#$%^&*()\-=_+{}|\[\]\\;':,./<>?"#quot:"]"," ">

Please try the following:
  • Copy and paste the following into your Everything search box:
    /tray_show_command_line=-s* #[:#regex-replace:<#clipboard:,"[`~!@#$%^&*()\-=_+{}|\[\]\\;':,./<>?"#quot:"]"," ">#]:
  • Press ENTER in your Everything search box.
  • If successful, tray_show_command_line=-s* #[:#regex-replace:<#clipboard:,"[`~!@#$%^&*()\-=_+{}|\[\]\\;':,./<>?"#quot:"]"," ">#]: is shown in the status bar for a few seconds.
-s*
#[: ... #]:
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

Thanks for the response.

The /tray_show_command_line= command worked, and got rid of the sticky token.

The RegEx works too, but again I cannot let it be there permanently in the Search Bar.
(In that case I cannot use Everything for any other purposes, and it will become a one-trick horse!)

So I need to save the RegEx somehow for using it frequently.

To sum up, this is not an intuitive method, and it needs the following refinements:

1. Once we enter the token in the Search Bar, it may or may not be replaced with actual text.
There is no consistency.
(e.g. the clipboard token was replaced with actual text, but your RegEx expression is not.)

2. If the token is converted to actual text, we lose sight of what the token was.
From the second search, Everything is on autopilot.
It shows something, and we have no clue what it is.

3. To clear the token, we have enter a cryptic formula in the Search Bar.
There is no "Clear" button next to the Search Bar.

4. It is not easy to know/remember what the RegEx does.
Many users like me just copy some RegEx formula from the forum and use it.
If they see any RegEx in their collection, they cannot figure out which RegREx does what.

Therefore, the user should be able to save the formula as a search preset with a meaningful name.
Further, he should be able to recall any of the saved formulas from a drop-down menu.

5. The user should be able to export the presets, so that he can save them and import them later.
This will also allow him to use the same settings across multiple computers.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Option to monitor clipboard

Post by NotNull »

You can save the current search as a bookmark (Menu:Bookmarks > Add to Bookmarks) and give it a 'human-friendly' name to open it later on when needed (Menu:Bookmarks > "Clipboard").

Bookmarks are stored in a CSV file in the %APPDATA%\Everything folder.

A backup/restore of settings in under development (Menu:Tools > Import and export settings)
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

This is fantastic!!

I am discovering more and more powerful features every single day!

I had gone through the entire menu system systematically, but skipped the bookmarks because I thought that they mean "favorite places".

But I now realize that "bookmark" in Everything is a wholly new idea!

BTW I searched for help page on bookmarks, but could not find it.
The most logical place is the help doc, but the bookmark interface is not explained there.
The forum does have threads about bookmarks, but they do not provide all information in one place.

IMHO the TOC on the left should have a "Bookmarks" node, which leads to a dedicated page about bookmarks.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Option to monitor clipboard

Post by NotNull »

Raindrops wrote: Fri Jan 27, 2023 4:22 am The most logical place is the help doc, but the bookmark interface is not explained there.
It is under the Searching node.
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Option to monitor clipboard

Post by Raindrops »

Yes, I realized belatedly that a bookmark is nothing but saved search (=search preset).
Based on that discovery, I have made a suggestion that this feature should be called "Search preset" or "saved search".

You have highlighted yet another consequence of naming a search as bookmark: The user will not be able to find its help!
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: Option to monitor clipboard

Post by void »

search_edit_paste_format might be of interest.
Post Reply