
auto fill in
Moderators: JRL, Dorian (MJT support)
auto fill in
i have created a auto fill in macro for a web page and im having a problem with a drop down menu where the state goes does anyone know how to write a macro to select a state in a drop down menu. any help would greatly be apreciated ..thanks tim 

Tab to the dropdown list on the page. Field should appear as selected. Press the up/down button till the option you wanna choose will appear.
Example, the dropdownlist at this forum: Display posts from previous: 6 Months
//move to the field by pressing Tab several times
Press Tab*x
//preselect the field directly by sending a character
Send>6
//if the character can't be catched directly move to it by pressing up or down
Press Up
//Press Tab to move away from the field
Press Tab
Example, the dropdownlist at this forum: Display posts from previous: 6 Months
//move to the field by pressing Tab several times
Press Tab*x
//preselect the field directly by sending a character
Send>6
//if the character can't be catched directly move to it by pressing up or down
Press Up
//Press Tab to move away from the field
Press Tab
AUTO SUBMIT
thanks for the help it works know i have a txt file that i want to get the press tab numeric value from .any sujestions please help tim...thnks 

Use ReadLn to read from the text file. You may also need to do some string manipulation with MidStr and Position.
MJT Net Support
[email protected]
[email protected]
auto submit
[quote="support"]Use ReadLn to read from the text file. You may also need to do some string manipulation with MidStr and Position.[/quote
i tryed that and it dint work.
what i need to do is read the line then have the line = press tab *theline from the line in my text file so is this posible ?
i tryed that and it dint work.
what i need to do is read the line then have the line = press tab *theline from the line in my text file so is this posible ?
the text box that i need to fill is a drop down that is the statesupport wrote:Hi,
Yes:
ReadLn>filename,linenum,theline
Press Tab * %theline%
i have tryed the above method and it is not working . is the another way to read a line in a text file and then tell it to press down the aproerate numbe of times from the text file ?
i hjave tried
Readln>c:\credit.txt,22,theline
press dn *%theline%
and is isnot workin ...HELP PLEASE>>>>thanks Tim

You need to TAB to the control and THEN press down:
Press Tab * x
Press Down * xx
Press Tab * x
Press Down * xx
MJT Net Support
[email protected]
[email protected]
yes i undestand that i need to use the tab to get to the feild...support wrote:You need to TAB to the control and THEN press down:
Press Tab * x
Press Down * xx
what im trying to ask you is ...i have a text file that has a line in with the numeric value that equal a state for example CA would = 1
or FL would = 10
i would like to be able to read this value and sendit as the press down value. mabe i didnt explane myself clear enuff... i understan the readln function im useing it in the rest of my macro.so my question is how do i readln> then send>as the press down value ?thank you for your support .....tim

Hi,
I don't really understand the format of your text file. Can you explain the format or email it to me? Then I might be able to help better.
Perhaps you can also give us a URL where we can test this out too - otherwise we're working blindfolded.
I don't really understand the format of your text file. Can you explain the format or email it to me? Then I might be able to help better.
Perhaps you can also give us a URL where we can test this out too - otherwise we're working blindfolded.
MJT Net Support
[email protected]
[email protected]
YES for example alaska will alway be 01 and florida = 10armsys wrote:Hi Tim,
I'm not sure if we understand your query corecctly. Do you want to read in the 2-digit value from a text file and send the corresponding state name to the keyboard? That is, whenever readln> encounter 01, CA or California will be sent to the field. Is this your goal?
i want to use this numeric value as a presdown 10 times witch would result in that the state box would the equal florida. thanks for you help...Tim


This is the easy bit.
The bit we haven't yet figured out is how we extract the numeric value which we then use to drop down the box.
We need to understand your file format and understand where in the file the numeric value appears, what logic is required to locate the correct line and where in the line it appears so that we can extract only the numeric portion.
e.g it could be:
Find the first line that equals "Florida"
then move on 3 lines to get the numeric code
extract that line
take the 2nd and 3rd chars to get the code ...
Or it might be something quite different. The point is we need to understand where everything appears in the file before we can know how to extract the required data from it.
The bit we haven't yet figured out is how we extract the numeric value which we then use to drop down the box.
We need to understand your file format and understand where in the file the numeric value appears, what logic is required to locate the correct line and where in the line it appears so that we can extract only the numeric portion.
e.g it could be:
Find the first line that equals "Florida"
then move on 3 lines to get the numeric code
extract that line
take the 2nd and 3rd chars to get the code ...
Or it might be something quite different. The point is we need to understand where everything appears in the file before we can know how to extract the required data from it.
MJT Net Support
[email protected]
[email protected]
I suppose your cursor is currently pointed to the first state, ie, Alabama, in a listbox just like booking a room with Travelodge, Super 8,..etc. I wrote the following script:
Readln>c:\temp\state.txt,1,Line
Sub>Line,1
If>Line=0,End
Press down *%line%
Labe>End
The above state.txt contains the following sample data:
01
05
08
39
Becuase Alabama is always the first state, you don't have to move your cursor. For the rest of states, just minus 1 to offset it. For Alaska, you just have to move cursor down only once.
Readln>c:\temp\state.txt,1,Line
Sub>Line,1
If>Line=0,End
Press down *%line%
Labe>End
The above state.txt contains the following sample data:
01
05
08
39
Becuase Alabama is always the first state, you don't have to move your cursor. For the rest of states, just minus 1 to offset it. For Alaska, you just have to move cursor down only once.
Can't understand the issue.
A list of states will be static.
If you want to get the right state, use an ini file.
ReadLN>C:\MyLetter.txt,1,StateToGet
ReadIniFile>C:\States.ini,states,%StateToGet%,StepsToMake
Tab*%StepsToMake%
You could have an additional check using WaitRectChanged> to be sure if the choosen state is the correct one.
If I've missed the point, ignore it ...
A list of states will be static.
If you want to get the right state, use an ini file.
ReadLN>C:\MyLetter.txt,1,StateToGet
ReadIniFile>C:\States.ini,states,%StateToGet%,StepsToMake
Tab*%StepsToMake%
- States.ini
[states]
alaska=1
alabama=2
arkansas=3
california=4
colorado=5
...
Florida=10
...
You could have an additional check using WaitRectChanged> to be sure if the choosen state is the correct one.
If I've missed the point, ignore it ...