News:

Welcome to our NEW forum! We invite you to sign up today
so it can grow to be a valuable resource to all Toolbox users!

Main Menu

[Tip] Search for text in the current folder, image, or window

Started by Paul (Lead Developer), May 27, 2026, 10:00:31 PM

Previous topic - Next topic

Paul (Lead Developer)

Sometimes you are looking at an image (or folder/window) that has a lot of text, and you need to know if certain text is visible in it. For documents, you'd normally use the search function with the document's app, but for viewed images or a folder/window this isn't possible. This action, when bound to a hotkey, will search the current visible portion of a folder, image or window for the text you specify. Just press the hotkey when the item is active, and enter the text to find. You will then be told if the text is present or not (the action can't highlight or select the text for you).

Note: This action uses Windows OCR, so any failure to find the text is due to Windows (the OS) and not AlomWare Toolbox. ;D

(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 Alert: Ask for a line of text "Search for this text:"
0002 Window: Assign active ""
0003 Window: Set windoc$ variable ""
0004 Action: Do this block if "windoc$<>blank$"
0005  Image: Assign "windoc$"
0006  Data: Assign "image"
0007 Action: End of block ""
0008 Action: Do this block if "windoc$=blank$"
0009  Image: Assign "window"
0010  Data: Assign "window"
0011 Action: End of block ""
0012 Action: Match case "0"
0013 String: Assign from assigned image ""
0014 Action: Do next step if "string$?alert$"
0015  String: Assign "The data$ DOES contain "alert$"."
0016 Action: Do next step if "string$!alert$"
0017  String: Assign "The data$ does NOT contain "alert$"."
0018 Alert: Show a message "string$"
(End)

[Edited to clarify visible portion. For example, a long folder of files won't be searched; just the on-screen visible portion of it].

oblivion

Not sure why it's taken me so long to try this extremely cool action.

I should say that it works perfectly but it wouldn't work for me until I'd added

0001 Wait: For action hotkey to be released ""
at the first line.

Paul (Lead Developer)

Thanks for sharing how to make it work for you, Oblivion. It's not needed here for my PCs, but I'm glad you sorted it for yourself. :)

I did toy with the idea of making an action not run until its hotkey is released, but that would break some actions from running immediately and/or correctly, such as this magnifying glass one: https://www.alomware.com/forum/index.php?topic=191.0