beginner question

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ebd
Newbie
Posts: 4
Joined: Fri Apr 04, 2003 5:58 pm
Contact:

beginner question

Post by ebd » Tue Sep 18, 2007 9:30 pm

Unlearned as I am I can't figure out how to do this right. Can someone straighten me out?
TIA...

//the open error window Costing Utilities text is what I'm trying to confirm

SetFocus>Costing Utilities
Press CTRL
Send>c
Release CTRL
Wait>1
GetClipBoard>"clipboard"
Wait>1

//this is what actually is on the clipboard

If>"clipboard"="---------------------------
Costing Utilities
---------------------------
Accounting period is closed - posting to this period is not allowed
---------------------------
OK
---------------------------"
Let>MSG_STAYONTOP=1
MessageModal>"Yep"
else
Let>MSG_STAYONTOP=1
MessageModal>"Nope"
endif

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue Sep 18, 2007 10:24 pm

#1 forget using quotes, macroscheduler doesn't use them. e.g.

GetClipBoard>"clipboard"

should be

GetClipBoard>clipboard

and

MDL>"yep" will display "yep" not yep

#2 the If> can't run over multiple lines like that. I don't have that screen to play with, but for example if I capture

First Line
Second Line

to the clipboard from notepad this If> will work:

If>clipboard=First LineSecond Line

But it has to have exactly the right number of spaces etc.

#3 I would do this differently by looking for a key word, e.g. closed, in that window:

GetClipBoard>clipboard
Pos>closed,clipboard,1,itsclosed
MDL>itsclosed

If the clipboard contains closed then itsclosed will return a value other than 0, if it doesn't then itsclosed will be 0. You can do your If> based on the value of itsclosed.

ebd
Newbie
Posts: 4
Joined: Fri Apr 04, 2003 5:58 pm
Contact:

Post by ebd » Tue Sep 18, 2007 11:09 pm

Thanks much for your help, I'll try your suggestions

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts