Help Needed with scripting.

Hints, tips and tricks for newbies

Moderators: JRL, Dorian (MJT support)

Post Reply
webwolf
Newbie
Posts: 4
Joined: Tue Apr 18, 2006 3:31 pm

Help Needed with scripting.

Post by webwolf » Tue Apr 18, 2006 3:42 pm

I need a script that should be simple, but i don't have the knowlage to create. recording a macro is too unstable.

Please Help!

First open an application from a location.
wait 30 seconds
type user id
wait 10 seconds
type password
wait 10 seconds
press down arrow 1 then enter
wait 10 seconds
press up arrow 3 then enter
enter todays date -18 days - will auto enter
wait 5 seconds
enter todays date - 6 days - will auto enter
wait 5 seconds
enter TEXT I
wait 2 seconds
enter TEXT *
wait 2 seconds
enter TEXT B
wait 2 seconds
enter TEXT 7
wait 2 seconds
enter TEXT D
wait 2 seconds
enter TEXT all
wait 2 seconds
Press CTRL+E

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

Post by JRL » Tue Apr 18, 2006 5:09 pm

You have practically written the macro with your description. I guess I don't understand the statement:
recording a macro is too unstable.
A recorded macro is nearly identical to what one would write. I say "nearly" because one might write the macro to be more efficient than the recorded macro, otherwise they are the same.

Try recording your macro then look at the results in the editor. From your description, the only obvious commands that you might need to alter would be your wait times. This should be easily understandable when you look at the recorded script.

When you get started and if you have a problem, let us know and we'll be happy to help.

Later,
Dick

webwolf
Newbie
Posts: 4
Joined: Tue Apr 18, 2006 3:31 pm

Macro

Post by webwolf » Wed Apr 19, 2006 7:53 am

when recording the macro, to input the date using an excel copy paste between applications, if any of the applications moved screen position, the macro would fail.
thats why i was looking for more direct commands to open the application and input this data, including the 2 date ranges at the start.
key strokes don't change, but window possitions might.

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

Post by JRL » Wed Apr 19, 2006 12:35 pm

It is true that the window positions can change. There are commands available that can be inserted into the script to remedy that problem.

I still think that you should record your process and get the bulk of your script written for you automatically. Then open the resulting script with the editor and make changes to make the script more "stable". Feel free to ask questions about whatever problems you may have along the way. There is also a search feature available for this forum, many questions you might have are probably already answered here if you look for them.

To write a script for you through the forum with the information that you've provided thus far is not possible. Also, you'll find the people here much more likely to spend their time helping someone who is making an obvious attempt to help themself. If you are looking for someone to write this script for you, there is a list of consultants that can be contacted.

Hope this is helpful, try recording, good luck,
Dick

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Apr 19, 2006 1:31 pm

If you need to write data to an Excel sheet or read from an Excel sheet, DO NOT use copy paste. DDERequest and DDEPoke are commands built to do these tasks for you. Very easy to use.

webwolf
Newbie
Posts: 4
Joined: Tue Apr 18, 2006 3:31 pm

Post by webwolf » Wed Apr 19, 2006 2:23 pm

Thats ok, but as i said, very new to this, may as well learn japanees, don't know got to get it to jump between 2 aps to get the date, would have been easier if macro could create the date from the system date minus whaterver amount of days.
I AM NO PROGRAMER! about the only thing i have managed to edit is the timings of when to does the command. that shows you the extent of my knowlage...hence the reason for talking in this forum.

i need to know the commands to load application 1, then copy a cell from excel, go bck to the first ap and paste. the key strokes i should be able to copy from the notbook demo. - or better still - if the macro can create the date range without using excel

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

Post by JRL » Wed Apr 19, 2006 2:35 pm

GetDate>var will set the variable "var" to today's date.

Sub>var,3 will subtract 3 days from the value of the date held by variable "var" and reset the value of "var" to the date 3 days ago.

To set your date range through Macro Scheduler you could do something like:

//Set the variable "Minus18" to today's date
GetDate>Minus18
//Set the variable "Minus6" to today's date
GetDate>Minus6
//Subtract 18 days and reset the value of "Minus18"
Sub>Minus18,18
//Subtract 6 days and reset the value of "Minus6"
Sub>Minus6,6

Hope this makes sense,
Dick

webwolf
Newbie
Posts: 4
Joined: Tue Apr 18, 2006 3:31 pm

Post by webwolf » Wed Apr 19, 2006 3:36 pm

thats cool, added to the end of the macro where it should input 2 dates. but does not type anything. application is waiting for typed date before moving on to the second date.

any ideas, i know this is hard to explain without seeing what i am doing so i have placed a screen shot of the screen http:\\www.reviewuk.net\macro\macrohelp.jpg

first i need to call up the application c:\folder\application\app.edp
can't get the run command to work.

then input the data, i have the user and password sorted, just stumped at the other data...sorry to be a pain....

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Apr 19, 2006 4:06 pm

You are not being a pain. Let me apologize if my capital letters came across as "unfriendly"....

There are tons of examples in the forum (just search) about using DDERequest to retrieve data from Excel.

if Run> doen't work with your app, you might try EXE> ....

Everyone here is willing to help, save yourself some time and search the forum whenever possible.

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

Post by JRL » Wed Apr 19, 2006 4:12 pm

You may have typoed the web site, I get nothing when I try to go there.

Make sure that the application screen is in focus. You might need to use:
SetFocus>Application window name

Then make sure the field to be filled in is active. You might need to:
Press TAB
one or more times to get to the proper field.

Then use the Send Character/Text> command: (abbreviated to Send>)
Send>%Minus18%

Let us know,
Dick

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Apr 19, 2006 4:41 pm

JRL,

Just reverse the direction of \ to /.....then you'll find the screens

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Apr 19, 2006 4:57 pm

I have read a bit about your emulator EXTRA! Personal Client. I have quite a bit of experience with scripting/macros within emulation sessions. If there is the possibility of scripting the EXTRA! session, then you might be better off to use a combination of MacroScript and whatever macro capabilities might be contained within EXTRA! Personal client.

could you tell us the version of the emulator, point us to a page with some support info, etc....??

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Apr 19, 2006 6:13 pm

Upon further investigation I have learned that your .edp file is, in fact, a macro which can only be run by Extra! Personal Client. At this point, probably not a bad idea to get some documentation for that macro language and utilize it for the "emulator" portion of this job.

Paul

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