Couple of Questions regarding Data entry and Dialog Box's

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
thebrazza
Newbie
Posts: 7
Joined: Thu Jun 28, 2007 3:50 pm

Couple of Questions regarding Data entry and Dialog Box's

Post by thebrazza » Fri Jul 13, 2007 8:33 am

Hi there,

I am currently evaluating and trying to convince my boss that we need this program! but i have come across a couple of walls.......

I’m trying to create a macro to enter data into a UI, i am getting the macro to get the data from an Excel spreadsheet and copy it into the relevant box. Which i can do if the data stays the same every time but on a couple of instances it doesn't.


For example...

Something that has a duration of 2 years needs a different output than one that has 4 years. the output is gotten from a drop down box in the UI by pressing Tab and down a certain number of times depending on duration.

you see what i mean?

if that is not possible then would it be possible for a dialog box to pop up with a continue button on it pausing the macro so that the user can manually select the relevant output and then click continue and the macro moves on.


The second question is.......

I want a dialog box to pop up in the middle of a macro allowing the user to input something into a box and then whatever is in that box to be pasted into a specific box in the UI


I know there are a few questions there; I appreciate in advance any solutions I can get :)

Thanks kindly

Jared

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jul 13, 2007 2:36 pm

Hi Jared,
In answer to your first question. If there is data available in your excel file that indicates 2 years or 4 years, the script can evaluate that information using If> statements and react accordingly by pressing "down" an appropriate number of times. Or you could also halt the script and have someone make a choice manually... but that sort of defeats the purpose of automating.

Your second question is also absolutely done every day by multitudes of happy Macro Scheduler users.

From your questions I'm assuming you are not writing any code, you are recording to get the code. I assume you are aware that you can edit the recorded code and add the features you are looking for?

If you post the code you have, indicate where you want the desired changes and post a sample of an excel record so that we can see what you're trying to do, the forum will be happy to try and help you accomplish your task.

thebrazza
Newbie
Posts: 7
Joined: Thu Jun 28, 2007 3:50 pm

Post by thebrazza » Fri Jul 13, 2007 3:19 pm

Thanks for the Reply,

i've been working on a few things, but have nothing Solid put together yet.

how do i get the script to recognise the copied peice of text as "1 year" or "2 years" from excel? using the if> statement

cheers

Jared

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jul 13, 2007 3:30 pm

Depends on what data is in Excel.

Lets imagine that you are taking one cell of information and that one cell either says "1 year" or "2 years". We have placed that cell information into a variable named "val". If "val" has the value "1 year" you want to press down 5 times and if it is "2 years" you want to press down twice. the code might look something like:

Code: Select all

If>%val%=1 year
  Press Down*5
EndIf
If>%val%=2 years
  Press Down*2
EndIf

thebrazza
Newbie
Posts: 7
Joined: Thu Jun 28, 2007 3:50 pm

Post by thebrazza » Fri Jul 13, 2007 3:45 pm

how do you place that value in a variable named val?


thanks

jared

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jul 13, 2007 3:58 pm

There are various ways. You first stated "i am getting the macro to get the data from an Excel spreadsheet and copy it into the relevant box.". So I would ask how is the script functioning now? It is apparently acquiring excel data and if that is so, a variable is created with the data assigned to it. You need to figure out what the name of the variable is that contains your data then have the script test that variable (using the If> command) to see which criteria the variable's contents meet.

As I stated earlier, it would be helpful if you could post the code you're working with.

thebrazza
Newbie
Posts: 7
Joined: Thu Jun 28, 2007 3:50 pm

Post by thebrazza » Fri Jul 13, 2007 4:05 pm

this is the one i'm using at the moment to do the same thing once the box is populated from excel.

// C:\Documents and Settings\jaredb\My Documents\Macro Scheduler\TEST Macro for Short.scp
// Recorded on Thursday, July 12, 2007, at 02:55 PM

//Recorded Events
Let>WW_TIMEOUT=5
CapsOff
MouseMove>359,8
Wait>4294967.62
LClick
Wait>0.02
MouseMove>753,47
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
LClick
WaitWindowOpen>Select Course Type
MoveWindow>Select Course Type,66,66
ResizeWindow>Select Course Type,247,144
Wait>0.01
MouseMove>753,47
Wait>0.02
Press Enter
WaitWindowOpen>UFIKeyinginterface
MoveWindow>UFIKeyinginterface,294,253
ResizeWindow>UFIKeyinginterface,239,100
Wait>0.01
MouseMove>753,47
Wait>0.03
Press Enter
WaitWindowOpen>UFIKeyinginterface
MoveWindow>UFIKeyinginterface,458,275
ResizeWindow>UFIKeyinginterface,363,145
Wait>0.01
MouseMove>753,47
Wait>0.04
Press Enter
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
MouseMove>830,10
Wait>0.55
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.01
MouseMove>830,10
Wait>0.03
LUp
Wait>0.01
MouseMove>735,128
Wait>1.21
LDown
Wait>0.01
MouseMove>735,128
Wait>0.01
LUp
Wait>0.01
MouseMove>735,128
Wait>0.07
Press Home
Wait>0.01
MouseMove>735,128
Wait>0.05
Press CTRL
Wait>0.01
MouseMove>735,128
Wait>0.01
Press Shift
MouseMove>735,128
Wait>0.02
Press End
Wait>0.01
MouseMove>735,128
Wait>0.02
Release CTRL
Wait>0.01
MouseMove>735,128
Wait>0.01
Release Shift
Wait>0.01
MouseMove>735,128
Wait>0.05
Press CTRL
Wait>0.01
MouseMove>735,128
Wait>0.02
Send>c
Wait>0.01
MouseMove>735,128
Wait>0.03
Release CTRL
Wait>0.01
MouseMove>735,128
Wait>0.06
Press Tab
Wait>0.01
MouseMove>290,988
Wait>0.99
LClick
WaitWindowOpen>Stargate - UFI-Course
MoveWindow>Stargate - UFI-Course,1,0
ResizeWindow>Stargate - UFI-Course,826,606
Wait>0.01
MouseMove>462,195
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
LClick
Wait>0.02
MouseMove>462,195
Wait>0.02
Press Home
Wait>0.01
Press Shift
Press End
Wait>0.01
Release Shift
Wait>0.01
Press Del
Wait>0.01
Press CTRL
Wait>0.01
Send>v
Wait>0.01
Release CTRL
Wait>0.01
MouseMove>830,11
Wait>0.68
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.01
MouseMove>830,11
Wait>0.03
LUp
Wait>0.01
MouseMove>809,130
Wait>0.45
LDown
Wait>0.01
MouseMove>809,130
Wait>0.01
LUp
Wait>0.01
MouseMove>809,130
Wait>0.06
Press Home
Wait>0.01
MouseMove>809,130
Wait>0.06
Press Shift
MouseMove>809,130
Wait>0.01
Press Shift * 4
MouseMove>809,130
Wait>0.01
Press End
Wait>0.01
MouseMove>809,130
Wait>0.03
Release Shift
Wait>0.01
MouseMove>809,130
Wait>0.04
Press CTRL
Wait>0.01
MouseMove>809,130
Wait>0.01
Send>c
Wait>0.01
MouseMove>809,130
Wait>0.02
Release CTRL
Wait>0.01
MouseMove>286,989
Wait>1.91
LClick
WaitWindowOpen>Stargate - UFI-Course
MoveWindow>Stargate - UFI-Course,1,0
ResizeWindow>Stargate - UFI-Course,826,606
Wait>0.01
MouseMove>266,165
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
LClick
Wait>0.02
MouseMove>266,165
Wait>0.03
Press Home
Wait>0.01
Press Shift
Press End
Wait>0.01
Release Shift
Wait>0.01
Press Del
Wait>0.01
Press CTRL
Wait>0.01
Send>v
Wait>0.01
Release CTRL
Wait>0.01
MouseMove>833,5
Wait>1.07
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.01
MouseMove>833,5
Wait>0.03
LUp
Wait>0.01
MouseMove>833,5
Wait>0.04
Press Tab
Wait>0.01
MouseMove>843,133
Wait>0.57
LDown
Wait>0.01
MouseMove>843,133
Wait>0.01
LUp
Wait>0.01
MouseMove>843,133
Wait>0.08
Press Home
Wait>0.01
MouseMove>843,133
Wait>0.07
Press CTRL
Wait>0.01
MouseMove>843,133
Wait>0.01
Press Shift
MouseMove>843,133
Wait>0.02
Press Shift * 10
Press End
Wait>0.01
MouseMove>843,133
Wait>0.02
Release CTRL
Wait>0.01
MouseMove>843,133
Wait>0.01
Release Shift
Wait>0.01
MouseMove>843,133
Wait>0.05
Press CTRL
Wait>0.01
MouseMove>843,133
Wait>0.01
Send>c
Wait>0.01
MouseMove>843,133
Wait>0.05
Release CTRL
Wait>0.01
MouseMove>843,133
Wait>0.06
Press Tab
Wait>0.01
MouseMove>296,983
Wait>1.95
LClick
WaitWindowOpen>Stargate - UFI-Course
MoveWindow>Stargate - UFI-Course,1,0
ResizeWindow>Stargate - UFI-Course,826,606
Wait>0.01
MouseMove>127,298
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
LDown
Wait>0.01
MouseMove>127,298
Wait>0.01
LUp
Wait>0.01
MouseMove>129,354
Wait>1.3
LDown
Wait>0.01
MouseMove>129,354
Wait>0.01
LUp
Wait>0.01
MouseMove>185,353
Wait>0.18
Press Home
Wait>0.18
Press CTRL
Wait>0.01
Press Shift * 11
Press End
Wait>0.01
Release CTRL
Wait>0.01
Release Shift
Wait>0.01
Press Del
Wait>0.01
Press CTRL
Wait>0.01
Send>v
Wait>0.01
Release CTRL
Wait>1.48
MouseMove>829,6
Wait>0.81
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.01
MouseMove>829,7
Wait>0.03
LUp
Wait>0.01
MouseMove>661,130
Wait>4.41
LDown
Wait>0.01
MouseMove>661,130
Wait>0.01
LUp
Wait>0.01
MouseMove>661,130
Wait>0.08
Press Home
Wait>0.01
MouseMove>661,130
Wait>0.03
Press CTRL
Wait>0.01
MouseMove>661,130
Wait>0.02
Press Shift
MouseMove>661,130
Wait>0.01
Press Shift * 3
MouseMove>661,130
Wait>0.01
Press Shift * 12
MouseMove>661,130
Wait>0.01
Press End
Wait>0.01
MouseMove>661,130
Wait>0.02
Release CTRL
Wait>0.01
MouseMove>661,130
Wait>0.01
Release Shift
Wait>0.01
MouseMove>661,130
Wait>0.03
Press CTRL
Wait>0.01
MouseMove>661,130
Wait>0.02
Send>c
Wait>0.01
MouseMove>661,130
Wait>0.05
Release CTRL
Wait>0.01
MouseMove>609,200
Wait>0.37
Press Tab
Wait>0.01
MouseMove>259,987
Wait>1.33
LClick
WaitWindowOpen>Stargate - UFI-Course
MoveWindow>Stargate - UFI-Course,1,0
ResizeWindow>Stargate - UFI-Course,826,606
Wait>0.01
MouseMove>121,269
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
LDown
Wait>0.01
MouseMove>121,269
Wait>0.01
LUp
Wait>0.01
MouseMove>118,522
Wait>1.29
LDown
Wait>0.01
MouseMove>118,522
Wait>0.01
LUp
Wait>0.01
MouseMove>117,522
Wait>1.28
Press CTRL
Wait>0.01
Press Shift
Press Shift * 30
Press End
Wait>0.01
Release CTRL
Wait>0.01
Release Shift
Wait>7.23
Press CTRL
Wait>0.01
Press Shift
Press Shift * 9
Press Home
Wait>0.01
Release CTRL
Wait>0.01
Release Shift
Wait>0.17
Press Home
Wait>0.01
Press CTRL
Wait>0.01
Press Shift
Press End
Wait>0.01
Release CTRL
Wait>0.01
Release Shift
Wait>0.01
Press CTRL
Wait>0.01
Send>c
Wait>0.01
Release CTRL
Wait>2.17
MouseMove>117,522
Wait>0.01
Press Del
Wait>1.11
MouseMove>832,10
Wait>1.38
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.01
MouseMove>832,10
Wait>0.05
LUp
Wait>0.01
MouseMove>830,10
Wait>0.03
Press Left
Wait>0.01
MouseMove>684,131
Wait>0.67
LDown
Wait>0.01
MouseMove>684,131
Wait>0.01
LUp
Wait>0.01
MouseMove>683,131
Wait>0.07
Press Home
Wait>0.01
MouseMove>683,131
Wait>0.02
Press CTRL
Wait>0.01
MouseMove>683,131
Wait>0.01
Press Shift
MouseMove>683,131
Wait>0.02
Press End
Wait>0.01
MouseMove>683,131
Wait>0.03
Release CTRL
Wait>0.01
MouseMove>683,131
Wait>0.01
Release Shift
Wait>0.01
MouseMove>683,131
Wait>0.03
Press CTRL
Wait>0.01
MouseMove>683,131
Wait>0.02
Send>c
Wait>0.01
MouseMove>683,131
Wait>0.04
Release CTRL
Wait>0.01
MouseMove>683,131
Wait>0.03
Press Tab
Wait>0.01
MouseMove>334,983
Wait>0.88
LClick
WaitWindowOpen>Stargate - UFI-Course
MoveWindow>Stargate - UFI-Course,1,0
ResizeWindow>Stargate - UFI-Course,826,606
Wait>0.01
MouseMove>278,514
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
LClick
Wait>0.02
MouseMove>278,514
Wait>0.02
Press Home
Wait>0.01
Press CTRL
Wait>0.01
Press Shift
Press End
Wait>0.01
Release CTRL
Wait>0.01
Release Shift
Wait>0.01
Press Del
Wait>0.58
Press CTRL
Wait>0.01
Send>v
Wait>0.01
Release CTRL
Wait>0.29
MouseMove>834,5
Wait>1.14
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.01
MouseMove>834,5
Wait>0.02
LUp
Wait>0.01
MouseMove>709,128
Wait>1.21
LDown
Wait>0.01
MouseMove>709,128
Wait>0.01
LUp
Wait>0.01
MouseMove>709,128
Wait>0.06
Press Home
Wait>0.01
MouseMove>709,128
Wait>0.04
Press Shift
MouseMove>709,128
Wait>0.01
Press End
Wait>0.01
MouseMove>709,128
Wait>0.02
Release Shift
Wait>0.01
MouseMove>709,128
Wait>0.07
Press CTRL
Wait>0.01
MouseMove>709,128
Wait>0.02
Send>c
Wait>0.01
MouseMove>709,128
Wait>0.03
Release CTRL
Wait>0.01
MouseMove>239,983
Wait>1.13
LClick
WaitWindowOpen>Stargate - UFI-Course
MoveWindow>Stargate - UFI-Course,1,0
ResizeWindow>Stargate - UFI-Course,826,606
Wait>0.01
MouseMove>318,357
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
LClick
Wait>0.02
MouseMove>318,357
Wait>0.02
Press Home
Wait>0.01
Press CTRL
Wait>0.01
Press Shift * 2
MouseMove>318,357
Wait>0.01
Press Shift * 16
Press End
Wait>0.01
Release Shift
Wait>0.01
Release CTRL
Wait>0.01
Press Del
Wait>0.01
Press CTRL
Wait>0.01
Send>v
Wait>0.01
Release CTRL
Wait>1.07
MouseMove>832,5
Wait>1.02
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.01
MouseMove>832,5
Wait>0.02
LUp
Wait>0.01
MouseMove>792,74
Wait>0.68
Press Tab
Wait>0.01
MouseMove>795,132
Wait>0.5
LDown
Wait>0.01
MouseMove>795,132
Wait>0.01
LUp
Wait>0.01
MouseMove>795,132
Wait>0.15
Press CTRL
Wait>0.01
MouseMove>795,132
Wait>0.01
Press Shift
MouseMove>795,132
Wait>0.02
Press Shift * 8
MouseMove>795,132
Wait>0.01
Press Shift * 12
MouseMove>795,132
Wait>0.01
Press Shift * 7
Release CTRL
Wait>0.01
MouseMove>795,132
Wait>0.02
Release Shift
Wait>0.01
MouseMove>795,132
Wait>0.05
Press Home
Wait>0.01
MouseMove>795,132
Wait>0.04
Press CTRL
Wait>0.01
MouseMove>795,132
Wait>0.02
Press Shift
MouseMove>795,132
Wait>0.01
Press Shift
Press End
Wait>0.01
MouseMove>795,132
Wait>0.02
Release CTRL
Wait>0.01
MouseMove>795,132
Wait>0.01
Release Shift
Wait>0.01
MouseMove>795,132
Wait>0.03
Press CTRL
Wait>0.01
MouseMove>795,132
Wait>0.02
Send>c
Wait>0.01
MouseMove>795,132
Wait>0.05
Release CTRL
Wait>0.01
MouseMove>795,132
Wait>0.05
Press Tab
Wait>0.01
MouseMove>317,983
Wait>1.25
LClick
WaitWindowOpen>Stargate - UFI-Course
MoveWindow>Stargate - UFI-Course,1,0
ResizeWindow>Stargate - UFI-Course,826,606
Wait>0.01
MouseMove>291,266
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
LDown
Wait>0.01
MouseMove>291,266
Wait>0.01
LUp
Wait>0.01
MouseMove>322,374
WaitWindowOpen>ufistart
MoveWindow>ufistart,34,344
ResizeWindow>ufistart,698,231
Wait>0.01
LClick
Wait>0.02
MouseMove>322,374
Wait>0.02
Press Home
Wait>0.01
Press Shift
Press End
Wait>0.01
Release Shift
Wait>0.01
Press Del
Wait>0.01
Press CTRL
Wait>0.01
Send>v
Wait>0.01
Release CTRL
Wait>3.98
Press Tab
Wait>0.01
MouseMove>322,374
Wait>5
Press Tab
Wait>0.01
MouseMove>322,374
Wait>0.01
Press Tab
Wait>0.01
MouseMove>322,374
Wait>4.53
Press Shift * 32
Press CTRL
Wait>0.01
Press End
Wait>0.01
Release CTRL
Wait>0.01
Release Shift
Wait>0.01
MouseMove>322,374
Wait>0.01
Press Del
Wait>0.01
Send>Sep/07
Wait>1.82
MouseMove>496,404
Wait>1.16
LDown
Wait>0.01
MouseMove>496,404
Wait>0.01
LUp
Wait>0.01
MouseMove>478,431
Wait>0.32
LDown
Wait>0.01
MouseMove>477,431
Wait>0.02
LUp
Wait>0.01
MouseMove>447,441
Wait>0.28
LDown
Wait>0.01
MouseMove>447,441
Wait>0.01
LUp
Wait>0.01
MouseMove>399,444
Wait>2.4
Press ALT
Wait>0.01
MouseMove>399,444
Wait>0.43
Send>a
Wait>0.01
Release ALT
Wait>0.01
MouseMove>837,11
Wait>1.73
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.01
MouseMove>837,11
Wait>0.02
LUp
Wait>0.01
MouseMove>809,127
Wait>6
LDown
Wait>0.01
MouseMove>809,127
Wait>0.01
LUp
Wait>0.01
MouseMove>809,127
Wait>0.1
Press CTRL
Wait>0.01
MouseMove>809,127
Wait>0.02
Press Shift
MouseMove>809,127
Wait>0.01
Press Home
Wait>0.01
MouseMove>809,127
Wait>0.02
Release CTRL
Wait>0.01
MouseMove>809,127
Wait>0.01
Release Shift
Wait>0.01
MouseMove>809,127
Wait>0.03
Press CTRL
Wait>0.01
MouseMove>809,127
Wait>0.02
Send>c
Wait>0.01
MouseMove>809,127
Wait>0.05
Release CTRL
Wait>0.01
MouseMove>314,992
Wait>1.35
LDown
Wait>0.01
MouseMove>314,992
Wait>0.02
LUp
WaitWindowOpen>Stargate - UFI-Course
MoveWindow>Stargate - UFI-Course,1,0
ResizeWindow>Stargate - UFI-Course,826,606
Wait>0.01
MouseMove>182,443
WaitWindowOpen>ufistart
MoveWindow>ufistart,34,344
ResizeWindow>ufistart,698,231
Wait>0.01
LDown
Wait>0.01
MouseMove>182,443
Wait>0.01
LUp
Wait>0.01
MouseMove>182,443
Wait>0.96
Press Home
Wait>0.01
Press CTRL
Wait>0.01
Press Shift * 2
Press End
Wait>0.01
Release CTRL
Wait>0.01
Release Shift
Wait>0.01
Press Del
Wait>0.01
Press CTRL
Wait>0.01
Send>v
Wait>0.01
Release CTRL
Wait>0.8
MouseMove>167,446
Wait>7.21
Press Left
Wait>0.01
MouseMove>167,446
Wait>0.01
Press Left
Wait>0.01
Press Backspace
Wait>0.01
Press Backspace
Wait>0.01
MouseMove>167,446
Wait>0.01
Press Left
Wait>0.01
Press Backspace
Wait>0.01
Press Backspace
Wait>0.01
Send>Sep
Wait>1.61
Press ALT
Wait>0.01
Send>a
Wait>0.01
MouseMove>832,4
Wait>1.47
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.01
MouseMove>832,4
Wait>0.02
LUp
Wait>0.01
MouseMove>832,4
Wait>0.06
Press Tab
Wait>0.01
MouseMove>860,128
Wait>0.69
LDown
Wait>0.01
MouseMove>860,128
Wait>0.01
LUp
Wait>0.01
MouseMove>860,128
Wait>0.1
Press Home
Wait>0.01
MouseMove>860,128
Wait>0.07
Press Shift
MouseMove>860,128
Wait>0.01
Press Shift * 4
MouseMove>860,128
Wait>0.01
Press Shift * 12
MouseMove>860,128
Wait>0.01
Press Shift * 10
Press End
Wait>0.01
MouseMove>860,128
Wait>0.03
Release Shift
Wait>0.01
MouseMove>860,128
Wait>0.03
Press CTRL
Wait>0.01
MouseMove>860,128
Wait>0.02
Send>c
Wait>0.01
MouseMove>860,128
Wait>0.02
Release CTRL
Wait>0.01
MouseMove>299,988
Wait>1.21
LClick
WaitWindowOpen>Stargate - UFI-Course
MoveWindow>Stargate - UFI-Course,1,0
ResizeWindow>Stargate - UFI-Course,826,606
Wait>0.01
MouseMove>531,438
WaitWindowOpen>ufistart
MoveWindow>ufistart,34,344
ResizeWindow>ufistart,698,231
Wait>0.01
LClick
Wait>0.02
MouseMove>531,438
Wait>0.03
Press CTRL
Wait>0.01
Send>v
Wait>0.01
Release CTRL
Wait>2.23
Press CTRL
Wait>0.01
Press Shift
Press Shift * 13
Press End
Wait>0.01
Release CTRL
Wait>0.01
Release Shift
Wait>0.01
Press CTRL
Wait>0.01
Press Shift
MouseMove>531,438
Wait>0.01
Press Shift * 11
Press Home
Wait>0.01
Release CTRL
Wait>0.01
Release Shift
Wait>0.01
Press Home
Wait>0.01
Press CTRL
Wait>0.01
Press Shift * 2
Press End
Wait>0.01
Release CTRL
Wait>0.01
Release Shift
Wait>0.01
Press Del
Wait>0.83
Press CTRL
Wait>0.01
Send>v
Wait>0.01
Release CTRL
Wait>0.29
Press ALT
Wait>0.01
Send>a
Wait>0.01
MouseMove>834,6
Wait>0.79
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.01
MouseMove>834,6
Wait>0.02
LUp
Wait>0.01
MouseMove>834,6
Wait>0.06
Press Right
Wait>0.01
MouseMove>834,6
Wait>0.08
LClick
Wait>0.02
MouseMove>834,6
Wait>0.07
Press Tab
Wait>0.01
MouseMove>833,126
Wait>0.58
LDown
Wait>0.01
MouseMove>833,126
Wait>0.01
LUp
Wait>0.01
MouseMove>833,126
Wait>0.09
Press Home
Wait>0.01
MouseMove>833,126
Wait>0.03
Press Shift
MouseMove>833,126
Wait>0.02
Press Shift
Press End
Wait>0.01
MouseMove>833,126
Wait>0.02
Release Shift
Wait>0.01
MouseMove>833,126
Wait>0.03
Press CTRL
Wait>0.01
MouseMove>833,126
Wait>0.02
Send>c
Wait>0.01
MouseMove>833,126
Wait>0.02
Release CTRL
Wait>0.01
MouseMove>833,126
Wait>0.05
Press Tab
Wait>0.01
MouseMove>833,126
Wait>0.02


I wrote this one below and was going to slot it into the part when the duration is copied over. but ideally i'd like to reconginise the duration with out haveing to copy images etc.




GetScreenRes>w,h
ScreenCapture>155,369,506,386,C:\Macro Images\Current Duration.bmp

//1 year
CompareBitmaps>C:\Macro Images\1 year.bmp,C:\Macro Images\Current Duration.bmp,match
If>match=100
Macro>C:\Documents and Settings\jaredb\My Documents\Macro Scheduler\1 year Duration.scp
Endif

//1-2 years
CompareBitmaps>C:\Macro Images\1-2 years.bmp,C:\Macro Images\Current Duration.bmp,match
If>Match=100
Macro>C:\Documents and Settings\jaredb\My Documents\Macro Scheduler\3-4 years Duration.scp
Endif

//2 years
CompareBitmaps>C:\Macro Images\2 years.bmp,C:\Macro Images\Current Duration.bmp,match
If>Match=100
Macro>C:\Documents and Settings\jaredb\My Documents\Macro Scheduler\2 years Duration.scp
Endif

//2-3 years
CompareBitmaps>C:\Macro Images\2-3 years.bmp,C:\Macro Images\Current Duration.bmp,match
If>Match=100
Macro>C:\Documents and Settings\jaredb\My Documents\Macro Scheduler\2 years Duration.scp
Endif

//3 years
CompareBitmaps>C:\Macro Images\3 years.bmp,C:\Macro Images\Current Duration.bmp,match
If>Match=100
Macro>C:\Documents and Settings\jaredb\My Documents\Macro Scheduler\2 years Duration.scp
Endif

//3-4 years
CompareBitmaps>C:\Macro Images\3-4 years.bmp,C:\Macro Images\Current Duration.bmp,match
If>match=100
Macro>C:\Documents and Settings\jaredb\My Documents\Macro Scheduler\3-4 years Duration.scp
Endif



anyways...thanks for your help.

:)

jared

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jul 13, 2007 4:52 pm

Ok, you used ctrl+c to copy the excel data to the clipboard. The command for retrieving from the clipboard is GetClipBoard>val where "val" is a variable name that you can choose. (sometimes making variable names descriptive makes it easier to debug the code.) On the assumption that you have copied one cell of data and the one cell contained text that is either "1 year" or "2 years".

The first part of your recorded macro has been revised. I took out some mousemoves that appeared to be unneeded to shorten this up a bit. Also changed your first wait which has you waiting 4294967.62 seconds or about 50 days. Then at the end I added some comments and the code to take the cell value from the clipboard and based on the value either press down 5 times or twice.

Also, please understand that the following script is an example of how this process could work. I don't have enough information to be able to write a working script.

hope this is helpful.

// C:\Documents and Settings\jaredb\My Documents\Macro Scheduler\TEST Macro for Short.scp
// Recorded on Thursday, July 12, 2007, at 02:55 PM

//Recorded Events
Let>WW_TIMEOUT=5
CapsOff
MouseMove>359,8
Wait>4
LClick
Wait>0.02
MouseMove>753,47
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
LClick
WaitWindowOpen>Select Course Type
MoveWindow>Select Course Type,66,66
ResizeWindow>Select Course Type,247,144
Wait>0.01
MouseMove>753,47
Wait>0.02
Press Enter
WaitWindowOpen>UFIKeyinginterface
MoveWindow>UFIKeyinginterface,294,253
ResizeWindow>UFIKeyinginterface,239,100
Wait>0.01
MouseMove>753,47
Wait>0.03
Press Enter
WaitWindowOpen>UFIKeyinginterface
MoveWindow>UFIKeyinginterface,458,275
ResizeWindow>UFIKeyinginterface,363,145
Wait>0.01
MouseMove>753,47
Wait>0.04
Press Enter
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
MouseMove>830,10
Wait>0.55
LDown
WaitWindowOpen>Microsoft Excel - BirkbeckMacroSheet.xls
MoveWindow>Microsoft Excel - BirkbeckMacroSheet.xls,-4,-4
ResizeWindow>Microsoft Excel - BirkbeckMacroSheet.xls,1288,979
Wait>0.03
LUp
Wait>1.21
LDown
Wait>0.01
LUp
Wait>0.07
Press Home
Wait>0.05
Press CTRL
Wait>0.01
Press Shift
Wait>0.02
Press End
Wait>0.02
Release CTRL
Wait>0.01
Release Shift
Wait>0.05
Press CTRL
Wait>0.02
Send>c
Wait>0.03
Release CTRL
Wait>0.06
Press Tab
Wait>0.01
MouseMove>290,988
Wait>0.99
LClick
WaitWindowOpen>Stargate - UFI-Course
MoveWindow>Stargate - UFI-Course,1,0
ResizeWindow>Stargate - UFI-Course,826,606
Wait>0.01
MouseMove>462,195
WaitWindowOpen>UFI-Course
MoveWindow>UFI-Course,7,41
ResizeWindow>UFI-Course,779,559
Wait>0.01
LClick
Wait>0.02
Press Home
Wait>0.01
Press Shift
Press End
Wait>0.01
Release Shift
Wait>0.01
Press Del
Wait>0.01
Press CTRL
Wait>0.01
Send>v
Wait>0.01
Release CTRL
Wait>0.01
//At this point go to the box where you need to choose.
//And I have no ides where this would be.
//Perhaps something Like:
//MouseMove>265,900
//LClick
//Wait>0.03

PutClipBoard>val
If>%val%=1 year
Press Down*5
EndIf
If>%val%=2 years
Press Down*2
EndIf



thebrazza
Newbie
Posts: 7
Joined: Thu Jun 28, 2007 3:50 pm

Post by thebrazza » Mon Jul 16, 2007 10:54 am

thanks for that,

i am still trying to get this bit to work

PutClipBoard>val
If>%val%=1 year
Press Down*5
EndIf
If>%val%=2 years
Press Down*2
EndIf

i'll keep you posted on how i get on


cheers

Jared

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