Form Script question

Discussion, questions and support.
Post Reply
car54
Posts: 5
Joined: May 2nd, ’17, 00:15

Post by car54 » Apr 5th, ’18, 23:27

I have a form I want to fill in with the following fields..

Surname: <prepopulated with my surname>
Given Name: <prepopulated with my Christian name)
Email Address:
Confirm Email Address: <will not accept pasted address><will accept drop and drag address>
Phone Number:
Street Number & Street Name:
Suburb:
City or Locality:
Postcode:

I'd like to copy the entire customer data from another form to the clipboard and paste it into this form.

I've made a simple script as follows...
Smith{Tab}
John{Tab}
[email protected]{Tab}
{Tab}
(+61) 0424444444{Tab}
10 Black Street{Tab}
Queanbeyan{Tab}
NSW{Tab}
2463{Tab}

When a execute the shortcut key <send> it copies all the data to the correct fields but a second later every bit of data disappears except the contents of the first line.

What am I doing wrong?
User avatar
Marko
Posts: 1726
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Apr 6th, ’18, 12:24

You should remove new lines and enclose "+" in braces, like {+}.
Try this:

Code: Select all

Smith{Tab}John{Tab}[email protected]{Tab}{Tab}({+}61) 0424444444{Tab}10 Black Street{Tab}Queanbeyan{Tab}NSW{Tab}2463{Tab}
car54
Posts: 5
Joined: May 2nd, ’17, 00:15

Post by car54 » Apr 8th, ’18, 04:18

Thanks for your reply. Perhaps I did not explain the requirement properly. My apologies.

I want to be able to extract a row of custom data with say 10 values from a csv or Google Sheets file (manually by <Ctl> C to clipboard or automatically by script) and then insert 5 values one by one into a government website form and a further 5 values into a second form and then submit the completed form. The site is accessed with a username and password.

My guess is I can record a macro of the insertion (pasting) process. But how do I process the copied csv data and incorporate it into the macro.

Any ideas?
User avatar
Marko
Posts: 1726
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Apr 8th, ’18, 17:04

Few ideas: Let's say you copied the following comma delimited text to the Clipboard:
Smith,John,[email protected]

You need to separate the values using StringSplit command and send them to the web form.

Code: Select all

;extract the data
StringSplit, Value, Clipboard, `,
Surname:=Value1
Name:=Value2
Mail:=Value3
;send the data to the form
Send, %Surname%{Tab}%Name%{Tab}%Mail%
You can also get the text from a file using FileRead, like this

Code: Select all

FileRead, String, C:\DataFile.txt
car54
Posts: 5
Joined: May 2nd, ’17, 00:15

Post by car54 » Apr 14th, ’18, 05:36

Wow! The script has worked perfectly. Thank you. This will save me so much key entry. Cheers.
Post Reply