bug-error with tooltips hiding hidden text

Discussion related to "Everything" 1.5.
Post Reply
Xavierarmand
Posts: 38
Joined: Fri Nov 24, 2023 12:19 am

bug-error with tooltips hiding hidden text

Post by Xavierarmand »

I've been using autohotkey to get the info of a selected file from an everything 1.5a window when its in the background, works great.

as I was playing to expand this into other menu items [e.g. i built a couple custom "open with" menus that capture the file path so I can send it to different text editors].

I was testing a couple code snippets with EV in the foreground and starting having errors where the selected file info was not being captured.
......................................................................

I have everything set to show tooltip in thumbnails view, and when mouseing over a file icon in detail view.
*when* an EV window is active and there is a tooltip visible the hidden text I was accessing in AHK disappears completely.
it took me almost a couple months to pinpoint what was happening, how, why and when. but now I duplicate this.

IF a tooltip is showing I won't get the hidden text, move the mouse so the tooltip go away, I will get the hidden text.
here's a screenshot, not the highlighted tooltip that's from the AHK code below...
Image

and then here I move the mouse so EV's tooltip hides itself and then the text is captured showing my menu...
Image



I should add am a noob at ahk and\or coding in genral. This is all new to me in the past year... EV is wonderfully advanced, I imagine there likely another way to get the details of an selected item without using AHK, maybe through the SDK?? If there is that still over my head so I've been playing with AHK for now (and loveing it)

here's a snippiet of the AHK v1 code I've been playing with..

Code: Select all

evgetselected:
DetectHiddenText, on ; the file path of selected item is hidden
WinGetText, selected, ahk_exe everything64.exe
if errorlevel ; if there is no EV window open stop here.
	{
		tooltip, An Everything window doesn't seem to be open.
		sleep 2000
		tooltip
		return
	}
	
;; EV has hidden text for a selected file, the full path is in the first line of text 
RegExMatch(selected, "m)^(.*)$", selected) ;; match first line of captured string, if multiple items are selected ev still only reports the most recently clicked

if !RegExMatch(selected, ".*\\([^\\]+)\\?$", "$1") ; match a file path in captured hidden text, if nothing is selected it tells you and stops here.
	{
		tooltip Everything is running thou nothing is selected.
		sleep 1500
		tooltip
		return
	}

sleep 50
SplitPath, selected, filename, dir, ext, filestem, drive ; splits the selected file path in to usable parts

; debug message box, shows what selected in its usable parts
; msgbox, selected: %selected%`n`n`nfilename: %filename%`ndir: %dir%`nfilestem: %filestem%`next: %ext%`n`nthismenuitem: %A_thismenuitem%`nthishotkey: %A_thishotkey%`nclip: %clipboard%

;; // the important part of this code about captureing the path of the selected item ENDS HERE



clipboard := ""
sleep 30
if (A_ThisMenuItem = "Full Path - Copy")
	{
		clipboard := selected
		return
	}
if (A_ThisMenuItem = "Dir Path - Copy")
	{
		clipboard := dir
		return
	}
if (A_ThisMenuItem = "Name - Copy")
	{
		Clipboard := filename
		return
	}
if (A_thismenuitem = "Open Dir Path")
	{
		run, %dir%
		return
	}
if (A_ThisHotkey = "$pause")
	{
		clipboard := selected
		return
	}
if (A_ThisHotkey = "$F9")
	{
		; clipboard := selected
		; copyclipboardCLM()
			; Activefile := Selected
			Selected := Activefile
			; restoreclipboard()
			goto alttxtuseclip
		; return
	}
return


this might be much todo about nothing. LOL. Now that I figured out what causing this strange error I can work around it. Not the end of the code! haha.

but I thought id share. Maybe it can be fixed at some point.

in anyway thank you void, EV is wonderful!

cheers
xavier
void
Developer
Posts: 19839
Joined: Fri Oct 16, 2009 11:31 pm

Re: bug-error with tooltips hiding hidden text

Post by void »

Please try the following script:

Code: Select all

evgetselected:
DetectHiddenText, on ; the file path of selected item is hidden

#Persistent

; Variables for the main window and child control
mainWindowClass := "EVERYTHING"
childControlClass := "EVERYTHING_RESULT_LIST_FOCUS"

; Get the handle of the main window
WinGet, mainWindowHandle, ID, ahk_class %mainWindowClass%
if !mainWindowHandle
{
		tooltip, An Everything window doesn't seem to be open.
		sleep 2000
		tooltip
		return
}

; Get the text from the child control
ControlGetText, selected, ahk_class %childControlClass%, ahk_id %mainWindowHandle%
if controlText =
{
		tooltip, An Everything window doesn't seem to be open.
		sleep 2000
		tooltip
		return
}

;; EV has hidden text for a selected file, the full path is in the first line of text 
RegExMatch(selected, "m)^(.*)$", selected) ;; match first line of captured string, if multiple items are selected ev still only reports the most recently clicked

if !RegExMatch(selected, ".*\\([^\\]+)\\?$", "$1") ; match a file path in captured hidden text, if nothing is selected it tells you and stops here.
	{
		tooltip Everything is running thou nothing is selected.
		sleep 1500
		tooltip
		return
	}

sleep 50
SplitPath, selected, filename, dir, ext, filestem, drive ; splits the selected file path in to usable parts

; debug message box, shows what selected in its usable parts
; msgbox, selected: %selected%`n`n`nfilename: %filename%`ndir: %dir%`nfilestem: %filestem%`next: %ext%`n`nthismenuitem: %A_thismenuitem%`nthishotkey: %A_thishotkey%`nclip: %clipboard%

;; // the important part of this code about captureing the path of the selected item ENDS HERE



clipboard := ""
sleep 30
if (A_ThisMenuItem = "Full Path - Copy")
	{
		clipboard := selected
		return
	}
if (A_ThisMenuItem = "Dir Path - Copy")
	{
		clipboard := dir
		return
	}
if (A_ThisMenuItem = "Name - Copy")
	{
		Clipboard := filename
		return
	}
if (A_thismenuitem = "Open Dir Path")
	{
		run, %dir%
		return
	}
if (A_ThisHotkey = "$pause")
	{
		clipboard := selected
		return
	}
if (A_ThisHotkey = "$F9")
	{
		; clipboard := selected
		; copyclipboardCLM()
			; Activefile := Selected
			Selected := Activefile
			; restoreclipboard()
			goto alttxtuseclip
		; return
	}
return
Get the main Everything window.
Get the hidden EVERYTHING_RESULT_LIST_FOCUS child window.
Finally get the text from the hidden window.
Xavierarmand
Posts: 38
Joined: Fri Nov 24, 2023 12:19 am

Re: bug-error with tooltips hiding hidden text

Post by Xavierarmand »

thanks for the reply, you know AHK??

so this doesn't work... But it getting closer.

its getting stuck on the first item it showed a tooltip for. Can't seem to clear that var. and its getting stuck in the 2nd ahk tooltip, I added %vars% to it, it is seeming more thou also not getting past that an EV is open when it is...

Code: Select all

 ; Variables for the main window and child control
mainWindowClass := "EVERYTHING"
childControlClass := "EVERYTHING_RESULT_LIST_FOCUS"
controltext := ""

; Get the handle of the main window
WinGet, mainWindowHandle, ID, ahk_class %mainWindowClass%
if !mainWindowHandle
{
		tooltip, An Everything window doesn't seem to be open.`n`nsub 1
		sleep 2000
		tooltip
		return
}

; Get the text from the child control
ControlGetText, controltext, ahk_class %childControlClass%, ahk_id %mainWindowHandle%
if controlText = ""
; if selected = ""
{
		tooltip, An Everything window doesn't seem to be open.`n`nsub 222`n%childControlClass%`n%mainWindowHandle%`ns:%selected%`nct:%controltext%
		sleep 5000
		tooltip
		controltext := ""
		return
} 
here is the snippet I dropped it into to play with...

Code: Select all

#Persistent
#SingleInstance, Force
			if (winactive("ahk_class EVERYTHING")) ; long press\hold  
			{ 
			; copyclipboardCLM()
			; Activefile := Clipboard
			; restoreclipboard()
			; goto alttxtuseclip
			DetectHiddenText, on ; the file path of selected item is hidden
			; WinGetText, selected, ahk_exe everything64.exe
			; if errorlevel
				; {
				; tooltip, An Everything window doesn't seem to be open.
				; sleep 2000
				; tooltip
				; return
				; }


 ; Variables for the main window and child control
mainWindowClass := "EVERYTHING"
childControlClass := "EVERYTHING_RESULT_LIST_FOCUS"
controltext := ""

; Get the handle of the main window
WinGet, mainWindowHandle, ID, ahk_class %mainWindowClass%
if !mainWindowHandle
{
		tooltip, An Everything window doesn't seem to be open.`n`nsub 1
		sleep 2000
		tooltip
		return
}

; Get the text from the child control
ControlGetText, controltext, ahk_class %childControlClass%, ahk_id %mainWindowHandle%
if controlText = ""
; if selected = ""
{
		tooltip, An Everything window doesn't seem to be open.`n`nsub 222`n%childControlClass%`n%mainWindowHandle%`ns:%selected%`nct:%controltext%
		sleep 5000
		tooltip
		controltext := ""
		return
} 


			RegExMatch(selected, "m)^(.*)$", selected) ;; match first line of captured string, if multiple items are selected ev still only reports the most recently clicked

			if !RegExMatch(selected, ".*\\([^\\]+)\\?$", "$1") ; match a file path in captured hidden text, 
				{
				tooltip Everything is running thou nothing is selected.
				sleep 1500
				tooltip
				return
				}
			; msgbox, %selected%

			sleep 50
			SplitPath, selected, filename, dir, ext, filestem, drive
			activefile := selected
			; goto alttxtuseclip
			MsgBox, 262144, , Selected :=`n%selected%, 5
			
is EVERYTHING_RESULT_LIST_FOCUS part of EV's SDK??
I need to do some more research on this.
Post Reply