Page 1 of 1

Get Inputs From User

Posted: Sun Aug 19, 2018 5:47 am
by ArashEB
I am working on my new task,I need to get 2 inputs from user and then use them later.

Forexample, the first input will get a username, and the second will get a password.

Then it's gonna paste each input, somewhere else (Like two separated TextAreas, or NotePad files ...)

How can I do it ?!

Re: Get Inputs From User

Posted: Thu Aug 23, 2018 9:16 am
by Oleg
Look at my example below.
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
This task inputs username and password and put them into Notepad

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|444033236
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task292"
Hide=INTEGER|0
ID=INTEGER|980746290
LogOnAsUser=INTEGER|1
Name=STRING|"Input username and password and use it"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_DIALOG_INPUTBOX"
Enabled=INTEGER|-1
Name=STRING|"Input Box (username)"
Params=FOLDER

[Actions\Action1\Params]
default=STRING|"none"
password=STRING|"0"
prompt=STRING|"Enter the user name (ESC to cancel)"
variable=STRING|"USERNAME"

[Actions\Action10]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 2 sec"
Params=FOLDER

[Actions\Action10\Params]
delay=STRING|"2"
dimension=STRING|"1"

[Actions\Action11]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER

[Actions\Action11\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"0"
keylayout=STRING|"0"
keys=STRING|"""Username: {username}"",""Password: {password}"""
pause=STRING|"20"
release=STRING|"0"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"

[Actions\Action2]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action2\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{username}"
value2=STRING|"none"

[Actions\Action3]
ActionID=STRING|"A_FLOW_EXIT"
Enabled=INTEGER|-1
Name=STRING|"Exit"

[Actions\Action4]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action5]
ActionID=STRING|"A_DIALOG_INPUTBOX"
Enabled=INTEGER|-1
Name=STRING|"Input Box (password)"
Params=FOLDER

[Actions\Action5\Params]
default=STRING|"none"
password=STRING|"1"
prompt=STRING|"Enter the password (ESC to cancel)"
variable=STRING|"PASSWORD"

[Actions\Action6]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action6\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{password}"
value2=STRING|"none"

[Actions\Action7]
ActionID=STRING|"A_FLOW_EXIT"
Enabled=INTEGER|-1
Name=STRING|"Exit"

[Actions\Action8]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action9]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""notepad.exe """
Params=FOLDER

[Actions\Action9\Params]
ifnonzero=STRING|"0"
program=STRING|"notepad.exe"
runas=STRING|"0"
wait=STRING|"0"