Macro to read data from a data file and enter in a program

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
wvanellis
Newbie
Posts: 3
Joined: Fri May 19, 2017 7:41 pm

Macro to read data from a data file and enter in a program

Post by wvanellis » Fri May 19, 2017 10:39 pm

I want to be able to do a macro of redundant data entry. The place the data goes is the same, but the data isn’t the same. I would like to read items from an excel file and enter the information in specific areas,

For example, I have a two column file with a list of ID and Program. I want to build a macro that opens a program, reads the ID number, enters the ID number, keystrokes down to the Program Field, reads the data from the Program field., enters that data in the program field, saves the record, returns to the top and repeats, but going to the next line of data.

I know how to get the keystrokes to maneuver the application, I need help on reading the data from a data file. Any ideas?


Wayne

---------------------------------

Below is the code where I can make the change to one record.

The two SendText Commands are where I want to enter and cycle through a list.

The list is in an excel file with the following two columns

ID PROGRAM
909385645 BSNSH15
909555000 BSAL01


//UIClick>{"Oracle Fusion Middleware Forms Services: Open > SGASTDN"},{"Oracle Fusion Middleware Forms Services: Open > SGASTDN"}

//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_9.bmp,WINDOW:Oracle Fusion Middleware Forms Services: Open > SGASTDN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif
Wait>.5

sendText>909385645 --THIS IS WHERE I WANT TO ENTER THE NEXT ID
Wait>.5
Press CTRL
Press Page Down
Release CTRL

Wait>2

//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_2.bmp,WINDOW:Oracle Fusion Middleware Forms Services: Open > SGASTDN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif
Wait>1
//Find and Left Click Bottom Right of
FindImagePos>%BMP_DIR%\image_4.bmp,WINDOW:Oracle Fusion Middleware Forms Services: Open > SGASTDN,0.7,4,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif
Wait>1
Press Tab
Press Tab
Press Tab
SendText BSNSH14 -- THIS IS WHERE I WANT TO ENTER THE CORRESPONDING CODE FOR THE NEXT ID
press Enter

//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_5.bmp,WINDOW:Oracle Fusion Middleware Forms Services: Open > SGASTDN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif
wait 1

//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_6.bmp,WINDOW:Oracle Fusion Middleware Forms Services: Open > SGASTDN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif

wait 1

//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_7.bmp,WINDOW:Oracle Fusion Middleware Forms Services: Open > SGASTDN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
LClick
Endif

wait 1
Press Backspace
Press Enter
Press Enter
Press Backspace
Press Enter

--I now want to repeat the ID and PROGRAM for the next item in the list.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Macro to read data from a data file and enter in a progr

Post by Marcus Tettmar » Mon May 22, 2017 6:34 pm

Please have a look at this:
http://help.mjtnet.com/article/138-tran ... or-web-app

And:
http://help.mjtnet.com/article/219-auto ... of-concept

Also see the Excel samples that come with the software- in the Samples group. These show you how to read your data from your Excel file.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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