I want to be able to open a text file, pull the text from the file then search to see if a specific word or phrase is used in the file. I am sure that I am making a simple mistake here and any help would be greatly appreciated.
Thanks!
GetWindowText>TEXT VERSION OF POSTAGE STATEMENT.TXT - Notepad,strText
wait>.25
if>%strText% = *Standard*
message>this is standard
else
message>this is not Standard
endif
Using wildcards in If statements
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7380
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
You can't use wildcards in IF statements. Instead you can use the Position command or RegEx:
Pos returns the position of a substring in another string. So if the result is zero there is no match, if positive the substring exists in the string.
Code: Select all
GetWindowText>TEXT VERSION OF POSTAGE STATEMENT.TXT - Notepad,strText
Pos>Standard,strText,1,posStandard
If>posStandard>0
MessageModal>this is standard
Else
MessageModal>not standard
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?