I am using a GUI to create text that I want to submit into two separate text boxes on a web form.
Right now, all the text related to the checked text boxes gets put on the clipboard and pasted as one clump.
To make it possible to split the text related to the GUI checkboxes, I'm thinking about separating the text somehow to textblock1 and textblock2.
Then send/paste textblock1 and textblock2 into different parts of a web form separated by {tab}. I would also send a few other keystrokes to completely fill out the web form.
The question that I am struggling with:
How could I approach modifying this script to break up the text from the checkboxes into textblock1 and textblock2 to input text separated by {tab} into different text boxes in a webform?
* This script is a variation on the script from this thread: GUI checkboxes to generate text in Edit control - viewtopic.php?style=1&f=76&t=109051&p=485975#p485531
Code: Select all
Gui, Add , Text ,, Insert Text
Gui, Add , CheckBox, vSRC gUpdate, Student Responsibility Checklist
Gui, Add , CheckBox, vI20 gUpdate, I-20
Gui, Add , CheckBox, vI94 gUpdate, I-94
Gui, Add , CheckBox, vVisa gUpdate, Visa
Gui, Add , CheckBox, vPPT gUpdate, Passport
Gui, Add , CheckBox, vDep gUpdate, Dependent Docs
Gui, Add , Text , wp y+20 , Email Template:
Gui, Add , Edit , w500 vtext r10
Gui, Add , Button , wp, Copy
Gui, Show, , E-mail
Return
Update:
Gui, Submit, NoHide
text = .... ; this text needs to be pasted into textbox 1 : ""
text .= SRC ? "SRC text" document : "" ; intended for textbox 1 : ""
text .= I20 ? "I20 text" document : "" ; intended for textbox 1 : ""
text .= I94 ? "I94 text" document : "" ; this text needs to be pasted into textbox 2 (separated by one tab on web form) : ""
text .= Visa ? "Visa Text" document : "" ; intended for textbox 2 : ""
text .= PPT ? "PPT Text" document : "" ; intended for textbox 2 : ""
text .= Dep ? "Dep Text" document : "" ; intended for textbox 2 : ""
GuiControl,, text, %text%
Return
ButtonCopy:
Gui, Submit, NoHide
Clipboard := "", Clipboard := text
ClipWait, 0
If ErrorLevel
MsgBox, 48, Error , An error occurred while waiting for the clipboard.
Else
;shift focus to what needs focus - using WordPad for testing purposes
{
if WinExist("Document - WordPad")
WinActivate ; Use the window found by WinExist.
sleep 100
Send, ^v ; would like to split this into text into textblock1 and textblock2 separated by a tab on the web form
send {tab}
send [standard text that needs to be sent into textbox 3 in web form]
send {tab}
send [standard text that needs to be sent into textbox 4 in web form]
}
Return
Return
Thank you so much for considering this with me!