Idiots guide to readln

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
fatisy786
Newbie
Posts: 2
Joined: Fri Feb 18, 2022 8:14 pm

Idiots guide to readln

Post by fatisy786 » Fri Feb 25, 2022 3:00 pm

Guys could really use some help, Just to give background I have literally no scripting experience,

I am wanting to create a macro that does the following. I have been told I can use readln to do the job but I have no idea how to do that. I am wanting to do the following:

I have a notepad file with 250 numbers on it. I need to create a macro that does the following.
copies the first line, set focus on a separate window, pastes it and then presses f1 and then repeats the process. how would I achieve this with readln

to Summarise

1.Notepad document copy line 1
2. set focus to window 1,paste and then press f1
3.copy line 2 and,
4.setofocus to window 1 paste and then press f1.
5.Repeat until all lines pasted

would be awesome if there is a way where I didn't even have to set focus and it pasted each
line and then pressed f1 after each iteration.

I look forward to hearing from you

Warm Regards
Mohammed Ali

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Idiots guide to readln

Post by Grovkillen » Fri Feb 25, 2022 5:18 pm

I would use read file and separate the file contents using the new lines. Then iterate through this array.

Not a dummy explanation but :

Read file
Separate file contents by line
Use this array to iterate :
Let>k=0
Repeat>k
...
Until>k=array_count

Within this repeat loop you send the number to your window. Press F1, wait etc.

No need to go back and forth between the windows.
Let>ME=%Script%

Running: 15.0.24
version history

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