Hi,
Any help would be greatly appreciated. I am trying to copy text from a web page and then compare that to a predefined word or words and use an IF THEN if it matches or not for my subroutines. I have tried all kinds of changes but none has worked. I figure this should be simple but I must be missing something. I am a novice so please forgive me if it is too simple.
It does copy the word correctly to the clipboard and the subroutines work, it is just the IF THEN ELSE that does not seem to compare or work.
Also, In IE 7 how can I focus to a tab? Right now it works but that tab has to be the active one.
Thanks
// C:\Program Files\Macro Scheduler\myscript.scp
//subroutines
SRT>PageMe
Let>SENDMAIL_STATUS=1
Let>subject=test
Let>me=[email protected]
Let>myname=MonkeyB
Let>smtp=mail.myserver.net
Let>SMTP_PORT=3535
Let>SMTP_AUTH=1
Let>SMTP_USERID=[email protected]
Let>SMTP_PASSWORD=test
Let>recipients=[email protected]
Let>body=Message from me
SMTPSendMail>recipients,smtp,me,myname,subject,body,
End>PageMe
SRT>FalseTest
Let>MSG_STAYONTOP=1
Message>WhatsInTheClipBoard
Wait>10
Goto>Start
End>FalseTest
Label>Start
Let>WW_TIMEOUT=5
SetFocus>Web Page - Windows Internet Explorer
CapsOff
MouseMove>129,327
Wait>2
LClick
Wait>0.1
MouseMove>136,412
Wait>1
LDblClick
Wait>1
Press CTRL
Wait>0.3
Send>c
Wait>0.17
Release CTRL
WaitClipBoard
GetClipBoard>WhatsInTheClipBoard
StringReplace>WhatsInTheClipBoard,%LF%,,WhatsInTheClipBoard
StringReplace>WhatsInTheClipBoard,%CR%,,WhatsInTheClipBoard
IF>WhatsInTheClipBoard=There
THEN Gosub>PageMe
ELSE Gosub>FalseTest
ENDIF
Label>end
Text from Clipboard won't compare with IF THEN
Moderators: JRL, Dorian (MJT support)
"There " with a space will not usually match "There" with no space. However, new with version 9 is the IGNOREPACES variable. If you insert the line:
Let>IGNORESPACES=1
From there on in the script, all space characters will be ignored. and "There " will equal "There".
Let>IGNORESPACES=0
Will set things back to "normal"
Let>IGNORESPACES=1
From there on in the script, all space characters will be ignored. and "There " will equal "There".
Let>IGNORESPACES=0
Will set things back to "normal"
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Or:
Include the space in the comparison - just put a space on the end of the line:
If>WhatsInClipBoard=There
There's a space at the end of the line above.
Or, more visible, and easier to read:
If>{%WhatsInClipBoard% = "There "}
Or, trim it first:
VBEval>Trim("%WhatsInClipBoard%"),WhatsInClipBoard
Or use Pos to do a substring search.
Or ...
Include the space in the comparison - just put a space on the end of the line:
If>WhatsInClipBoard=There
There's a space at the end of the line above.
Or, more visible, and easier to read:
If>{%WhatsInClipBoard% = "There "}
Or, trim it first:
VBEval>Trim("%WhatsInClipBoard%"),WhatsInClipBoard
Or use Pos to do a substring search.
Or ...
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?