Jump to content

Search for a String in the active Window


 Share

Recommended Posts

Hi,

I'm sorry for being a trouble but I have spent days trying to find some solution in the Forum and in the Help with no success.

I need to be able to check if a certain text appeared in the window in which the script is working, actually I know after which step there's a chance for an error message appearing in that window and somehow I need to detect that message.

I was thinking about pixelsearch but maybe there is a more suitable function or workaround I have not yet been able to find.

Any help, idea or advice if highly appreciated.

All the best,

Karasu

Link to comment
Share on other sites

Perhaps:

If StringInStr(WinGetText($WinTitle), $sSearchString) Then
   ; String found, do something about it!

EndIf

;)

Edit: Had to fix StringInStr before SmOke_N sees it and makes fun of m... DOH! :)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Moderators

Perhaps:

If StingInString(WinGetText($WinTitle), $sSearchString) Then
   ; String found, do something about it!

EndIfoÝ÷ Ûú®¢×®Ë«xýË«{*.æ§jëh×6StringInStr(WinGetText($WinTitle), $sSearchString)
:)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I promise to pay more attention on where I open a new topic. I'm really sorry about messing with the bug report.

Thanks for all your help, as I suspected the solution is rather simple (for those coding for years), but I would have never found it out by myself in the time given:D

Tomorrow I can try it, finish my script, and get some time to learn the helpfile by heart. Great!

Cheers,

Karasu

Link to comment
Share on other sites

Hi,

tried it and sadly it does not read the contents of the window, only the texts of the window itself. (like "File", "Edit", "View", "Favorites")..I can't really think of anything else, but I think I'll get hold of the bl**dy cursor, copy the whole stuff in front of me, and search that dump for the error code.

Difficult workarounds are the side effects of messing with a mainframe. yuck.

Thanks to everyone.

Karasu

Link to comment
Share on other sites

Hi,

do you have an 3270 emulation window?

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...