Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
-
- Posts: 43
- Joined: Wed Apr 08, 2015 10:00 pm
Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
I use Everything a lot, for multiple concurrent things, sometimes ending up with dozens of Search Windows open.
When it is necessary to reboot the computer I take care to properly CLOSE the Everything app so that all my open searches are saved in the Search History.csv file.
So, after restarting, I can of course look at the SearchHistory.csv file, AND/OR I can use View/Goto/AllSearchHistory and sort by "Last Searched".
HOWEVER: even though in the AllSearchHistory window you can select multiple lines at once, when you click OPEN only the last line touched is opened.
Therefore if I want to get back to my previous state of having the same many Search Windows open, the only option is to manually go to each former search expression in the History window and click open one by one.
VERY TIME CONSUMING!
Is there any way at all, perhaps by starting Everything from a command line and feeding it perhaps an edited SearchHistory.csv file and cause it to AUTOMAGICALLY open as many new Search Windows as I wish, each containing one of the provided search expressions.
That would be REALLY useful! (OR... if there was a way to select >1 in the Search History window and have OPEN button recognize that the user wants ALL of those former searches to be performed and opened in its own new search window, which would accomplish the same thing.)
THANKS FOR ANY SUGGESTIONS!
When it is necessary to reboot the computer I take care to properly CLOSE the Everything app so that all my open searches are saved in the Search History.csv file.
So, after restarting, I can of course look at the SearchHistory.csv file, AND/OR I can use View/Goto/AllSearchHistory and sort by "Last Searched".
HOWEVER: even though in the AllSearchHistory window you can select multiple lines at once, when you click OPEN only the last line touched is opened.
Therefore if I want to get back to my previous state of having the same many Search Windows open, the only option is to manually go to each former search expression in the History window and click open one by one.
VERY TIME CONSUMING!
Is there any way at all, perhaps by starting Everything from a command line and feeding it perhaps an edited SearchHistory.csv file and cause it to AUTOMAGICALLY open as many new Search Windows as I wish, each containing one of the provided search expressions.
That would be REALLY useful! (OR... if there was a way to select >1 in the Search History window and have OPEN button recognize that the user wants ALL of those former searches to be performed and opened in its own new search window, which would accomplish the same thing.)
THANKS FOR ANY SUGGESTIONS!
Re: Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
(Session Restore in Mozilla speak.
Yes, at times, I too would like to be able to Quit & save [Bookmark] each session window & each window's individual [back/fwd] histories too.)
Yes, at times, I too would like to be able to Quit & save [Bookmark] each session window & each window's individual [back/fwd] histories too.)
Re: Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
Here is a Powershell script that should do what (I think it is) you want:stevenroussos wrote: Is there any way at all, perhaps by starting Everything from a command line and feeding it perhaps an edited SearchHistory.csv file and cause it to AUTOMAGICALLY open as many new Search Windows as I wish, each containing one of the provided search expressions.
- Read "Search History.csv"
- Detect the most recent entry
- Get all entries that have a Last Search Date less than 24 hours older compared to the most recent one
- Manipulate the entries (command-line requires escaping of special chatacters)
- For each entry: start a new Everything window with this query and wait 2 seconds before proceeding to the next entry.
LoadHistory.ps1
Code: Select all
$DB = import-csv '.\Search History.csv'
$History = ($DB | sort -property 'Last Search Date' -descending)
$lastactive = $history[0].'Last Search Date'
$daybefore = ($mostrecent - 1000000000*60*60*24)
$recent = ($History | where -Property 'Last Search Date' -gt $daybefore)
foreach ($Query in $recent) {
$search = (-join ("-newwindow -search " , "`"" , ($Query.Search).Replace('"','"""') , "`""))
sleep 2
#Start-process .\everything.exe -Argumentlist "$search"
}
-
- Posts: 43
- Joined: Wed Apr 08, 2015 10:00 pm
Re: Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
THANK YOU!
My intent will be to copy the main .csv file and edit it to include entries to my wishes, which might include searches older than the last day.
In which case I guess I will edit the input file name to the name of the copy with my edited want list, then change
foreach ($Query in $recent) {
to
foreach ($Query in $DB) {
Does that sound right?
My intent will be to copy the main .csv file and edit it to include entries to my wishes, which might include searches older than the last day.
In which case I guess I will edit the input file name to the name of the copy with my edited want list, then change
foreach ($Query in $recent) {
to
foreach ($Query in $DB) {
Does that sound right?
Re: Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
Wish I knew that before ... In that case, you can get rid of a lot of overhead:
LoadHistory.ps1
Now you can drag the CSV file to this script to load the entries.
-or-
Start it with: LoadHistory.ps1 "My CSV file.csv"
-or-
Start the script without parms; it will ask for a filename
LoadHistory.ps1
Code: Select all
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$csv-file
)
import-csv $csv-file | foreach {
$search = (-join ("-newwindow -search " , "`"" , ($_.Filename).Replace('"','"""') , "`""))
sleep 2
Start-process .\everything.exe -Argumentlist "$search"
}
Now you can drag the CSV file to this script to load the entries.
-or-
Start it with: LoadHistory.ps1 "My CSV file.csv"
-or-
Start the script without parms; it will ask for a filename
-
- Posts: 43
- Joined: Wed Apr 08, 2015 10:00 pm
Re: Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
THANKS A MILLION! You should send this to VOIDTOOLS creator so it can be included in future releases. VERY handy!
Re: Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
You're welcome! But mostly, you should thank @void. He made this all possible...
I have to thank you too, btw. I want to get more fluent in Powershell. Questions like this are a good practice for that and also a lot of fun (apart from those <insert at least 10 curse words here> quotes ...)
I have to thank you too, btw. I want to get more fluent in Powershell. Questions like this are a good practice for that and also a lot of fun (apart from those <insert at least 10 curse words here> quotes ...)
I think @void follows closely what's going on in these forums ...stevenroussos wrote:You should send this to VOIDTOOLS creator so it can be included in future releases. VERY handy!
Re: Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
Added to my TODO list: restore previous session (support multiple windows) and allow user to open search history in existing window or new window.
-
- Posts: 43
- Joined: Wed Apr 08, 2015 10:00 pm
-
- Posts: 43
- Joined: Wed Apr 08, 2015 10:00 pm
Re: Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
Did you ever add a restore previous session function?
Re: Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
It is still on my TODO list.
-
- Posts: 43
- Joined: Wed Apr 08, 2015 10:00 pm
Re: Way to open multiple "New Search Window"s from a list of search expressions or a .csv file
Still "to do"? Seems like it should be fairly straightforward, but I realize you have a mountain of requests/tasks. But this would surely be one of the most useful & appreciated enhancements. Just a simple "restore last session." Other things like a list of previous-session searches and the ability to select/deselect as desired and an "Open" button would finesse it, but just a basic 1 shot "Restore Previous Session" would be loved by MANY I am sure.
THANKS!
THANKS!