When there are many search results, switching views via Postmessage is ineffective when called in the custom command.

Discussion related to "Everything" 1.5.
Post Reply
yahuu
Posts: 27
Joined: Wed Jul 24, 2024 9:56 am

When there are many search results, switching views via Postmessage is ineffective when called in the custom command.

Post by yahuu »

If the results are very few, it will succeed.
If there are many results, the view can switch normally if no files are selected or if one file is selected.
however, if multiple files are selected, there is a high probability that the switch will not be successful.

1. Search for *.pdf.
2. Switch to thumbnail view, and execute the following script separately to successfully switch Everything to detail view.

3. Set the following script as custom_open_command01 and assign the hotkey to F1.
4. Reset to thumbnail view, do not interact with the results list with the mouse, and press F1 to successfully switch to detail view.

BUG:
5. Reset to thumbnail view, select some files with the mouse, and press F1; the view does not change.

Code: Select all

#Requires AutoHotkey <v2.0
#SingleInstance Force
#NoTrayIcon
#NoEnv

for _, exe in ["Everything.exe", "Everything64.exe"]
	if WinExist("ahk_exe " exe)
	{
		WinActivate
		break
	}

WinGetClass, evclass, A
PostMessage 0X111,40102,0,,ahk_class %evclass%
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: When there are many search results, switching views via Postmessage is ineffective when called in the custom command

Post by void »

5. Reset to thumbnail view, select some files with the mouse, and press F1; the view does not change.
Unable to reproduce the issue my end, the view always changes to details.



Are you pressing F1 while still holding down the left mouse button?
-The F1 key press will be ignored while the left mouse button is down and you are selecting files.



custom_open_command01 is called for each selected file.
Unless you use %* in your command, then it is only called once.



What is your custom_open_command01 ?

It is shown under Help -> Troubleshooting information
yahuu
Posts: 27
Joined: Wed Jul 24, 2024 9:56 am

Re: When there are many search results, switching views via Postmessage is ineffective when called in the custom command

Post by yahuu »

Everything 1.5.0.1388a (x64)
OS: Windows NT 10.0 19044 (x64)
Admin: 1
Service: 0 (disconnected / not installed)
Command line: -startup
Binary: D:\Portable\Everything\Everything64.exe
Profile: D:\Portable\Everything\Everything.ini
Database: D:\Portable\Everything\Everything.db
Instance:

Config:
run_as_admin=1
index_as_admin=1
open_searches_in_tabs=1
hide_empty_search_results=1
toggle_window_key=2131
language=1033
statusbar_view_thumbnail_size=64
open_folder_command2=$exec("%tcdir%\TOTALCMD.EXE" /A /O /T /P=R /R="%1")
open_path_command2=$exec("%tcdir%\TOTALCMD.EXE" /A /S /P /O /T /P=R /R="%1")
explore_path_command2=$exec("%tcdir%\TOOLS\F4Menu\f4menu.exe" -b "%1")
custom_open_commands=[{"name":"计算Hash(&H)","type":3,"command"="$exec(\"%tcdir%\TOOLS\\HashMyFiles\\hashmyfiles.exe\" /files %*)"},{"name":"EverEdit(&E)","type":2,"filter"="*.txt;*.log;*.ini;*.cfg;*.csv;*.lrc;*.bat;*.ahk;*.xml","command"="$exec(\"%tcdir%\TOOLS\\EverEdit\\EverEdit.exe\" %*)"}]
alpha_instance=0
auto_include_removable_volumes=1
auto_remove_offline_ntfs_volumes=0
auto_move_ntfs_volumes=0
auto_include_fixed_refs_volumes=1
auto_include_removable_refs_volumes=1
auto_move_refs_volumes=0
auto_include_fixed_fat_volumes=1
auto_move_fat_volumes=0
auto_include_remote_volumes=1
filelist_preview=0
home_filter=1
path_hit_text_only=1
focus_search_on_activate=1
allow_literal_operators=1
convert_forward_slash_to_backslash=1
pinyin_type=0
db_location=D:\Portable\Everything
custom_verb01=EvResultToTC
custom_open_command01=$exec("%tcdir%\TOOLS\Scripts\EverythingResultSelToTC\111.ahk" "%*")
custom_open_command02=$exec("%tcdir%\TOOLS\Scripts\EverythingResultSelToTC\EverythingResultSelToTC.exe" 2 "%*")
filter=Online
filter_everything_name=所有
preview_visible=1
search_history_always_suggest=1
columns=[{"name":"Name","width":470},{"name":"Extension","width":59},{"name":"Size","width":90},{"name":"Date Modified","width":117},{"name":"Path","width":991}]
fat_volumes=[{"path":"Z:","volume_name":"\\\\?\\Volume{18...00}"}]
ntfs_volumes=[{"path":"C:","volume_name":"\\\\?\\Volume{e1...6b}"},{"path":"D:","volume_name":"\\\\?\\Volume{e1...6b}"},{"path":"E:","volume_name":"\\\\?\\Volume{5d...00}"},{"path":"F:","volume_name":"\\\\?\\Volume{5d...00}"},{"path":"G:","volume_name":"\\\\?\\Volume{5d...00}"},{"path":"H:","volume_name":"\\\\?\\Volume{38...00}"},{"path":"I:","volume_name":"\\\\?\\Volume{38...00}"},{"path":"J:","volume_name":"\\\\?\\Volume{01...86}"},{"path":"J:","volume_name":"\\\\?\\Volume{0f...00}"},{"path":"Q:","volume_name":"\\\\?\\Volume{fb...e1}"},{"path":"Z:","volume_name":"\\\\?\\Volume{3c...00}"}]
folders=[{"path":"T:"}]
exclude_folders="T:\\.zfs"

Policy:

Plugins:
yahuu
Posts: 27
Joined: Wed Jul 24, 2024 9:56 am

Re: When there are many search results, switching views via Postmessage is ineffective when called in the custom command

Post by yahuu »

void wrote: Sat Dec 28, 2024 10:47 pm Are you pressing F1 while still holding down the left mouse button?
-The F1 key press will be ignored while the left mouse button is down and you are selecting files.
Only pressed F1
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: When there are many search results, switching views via Postmessage is ineffective when called in the custom command

Post by void »

Please try capturing a debug log:
  • In Everything, from the Tools menu, under the Debug submenu, click Start debug logging...
  • Reproduce the issue.
  • From the Tools menu, under the Debug submenu, click Stop debug logging...
    ---This will open your %TEMP%\Everything Debug Log.txt in Notepad.
  • Please upload this file in a bug report


Running as admin might be causing a communication issue with your script.
(Typically this would cause all communication to fail, not some..)

Please make sure Everything is installed correctly and running as a standard user:
  • In Everything, from the Tools menu, click Options.
  • Click the General tab on the left.
  • Check Store settings and data in %APPDATA%\Everything.
  • Uncheck Run as administrator.
  • Check Everything Service. (Please make sure this is tick-checked and not square-checked)
  • Click OK.
  • Exit Everything (from the File menu, click Exit).
  • Restart Everything.
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: When there are many search results, switching views via Postmessage is ineffective when called in the custom command

Post by void »

Thank you for the logs.

The logs show Everything executes the script.



One thing that might be causing an issue is the double quotes around %*
%* will automatically quote parameters.
So the double double quotes will end up cancelling each other out..

Please try the following commands:

$exec("%tcdir%\TOOLS\Scripts\EverythingResultSelToTC\111.ahk" %*)


$exec("%tcdir%\TOOLS\Scripts\EverythingResultSelToTC\EverythingResultSelToTC.exe" 2 %*)


Does the issue persist?
yahuu
Posts: 27
Joined: Wed Jul 24, 2024 9:56 am

Re: When there are many search results, switching views via Postmessage is ineffective when called in the custom command

Post by yahuu »

The command was used. The problem still exists.

Code: Select all

$exec("%tcdir%\TOOLS\Scripts\EverythingResultSelToTC\test.ahk" %*)
In thumbnail view, when selecting multiple files and pressing a hotkey once, the focus jumps to the address bar, and the actions for switching views and minimizing EV are not executed.
When selecting multiple files again and pressing the hotkey, the action is executed successfully.

Code: Select all

#Requires AutoHotkey <v2.0
#SingleInstance Force
#NoTrayIcon
#NoEnv

for _, exe in ["Everything.exe", "Everything64.exe"]
	if WinExist("ahk_exe " exe)
	{
		WinActivate
		break
	}

WinGetClass, evclass, A
PostMessage 0X111,	40102,0,,ahk_class %evclass%
PostMessage 0x0112, 0xF060,,, ahk_class %EVclass%
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: When there are many search results, switching views via Postmessage is ineffective when called in the custom command

Post by void »

Please check if you have a duplicate F1 key binding:

In Everything, type in the following search and press ENTER:

about:keys

Search for F1
yahuu
Posts: 27
Joined: Wed Jul 24, 2024 9:56 am

Re: When there are many search results, switching views via Postmessage is ineffective when called in the custom command

Post by yahuu »

File | Custom Open 1 F1 (Result List)
File | Custom Open 2 Alt+F1 (Result List)
Help | About Everything Ctrl+F1 (Global)
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: When there are many search results, switching views via Postmessage is ineffective when called in the custom command

Post by void »

The script is unlikely to work as you are posting the message to the active window.
Even though you activate Everything, Everything might not be the active window in your PostMessage call.



Please try the following script:

Code: Select all

#Requires AutoHotkey <v2.0
#SingleInstance Force
#NoTrayIcon
#NoEnv

for _, exe in ["Everything.exe", "Everything64.exe"]
	if WinExist("ahk_exe " exe)
	{
		WinActivate
		break
	}

PostMessage 0X111,40102,0,,ahk_class EVERYTHING
(Changed class to EVERYTHING)
yahuu
Posts: 27
Joined: Wed Jul 24, 2024 9:56 am

Re: When there are many search results, switching views via Postmessage is ineffective when called in the custom command

Post by yahuu »

Solved, thank you very much!
Post Reply