Page 1 of 1

Can A Script Do Something Depending On Whether it Finds Something?

Posted: 20 Dec 2018, 12:45
by Hampoon
Hey there, I'm pretty new to this language. I was wondering if I could make a script do something like ctrl+f on a webpage and then if it does find something do something, and then if it doesn't do something else. Is this possible? Thanks!

Re: Can A Script Do Something Depending On Whether it Finds Something?

Posted: 20 Dec 2018, 13:34
by RickC
Look in the Commands documentation (https://autohotkey.com/docs/commands/index.htm) for both If and Else for explanations and examples of program flow.

Re: Can A Script Do Something Depending On Whether it Finds Something?

Posted: 20 Dec 2018, 14:25
by Hampoon
RickC wrote:
20 Dec 2018, 13:34
Look in the Commands documentation (https://autohotkey.com/docs/commands/index.htm) for both If and Else for explanations and examples of program flow.
Reasons this doesn't help me:
1. I am trying to find text, not a color.
2. I have barely any idea how anything works and most of the tutorial makes no sense whatsoever to me because I'm new.

Re: Can A Script Do Something Depending On Whether it Finds Something?

Posted: 20 Dec 2018, 14:44
by oif2003
Hi,
Being new is more the reason to check out the tutorials! Here's the official one: https://www.autohotkey.com/docs/Tutorial.htm
Good luck!

Re: Can A Script Do Something Depending On Whether it Finds Something?

Posted: 20 Dec 2018, 17:01
by ManaUser
Short answer: Yes scripts can certainly do that.

Long answer: It depends on a whole bunch of things, so this is kinda hard to answer. Web browsers in particular are not the most friendly things to extract text from, for instance. Simple programs like notepad are much easier. On the other hand, looking at the title of any window is easy. There's just a bunch of factors to consider. Chances are what you want to do is possible. But depending on the details it could be anything from "one line of code" easy to "is this really worth the effort?" hard. You'll probably get more helpful answers if you ask a more specific question about a certain thing you're trying to accomplish.