-----------------------------------------------------------------------------
Q #1: Does anybody have a way of finding
out whether a checkbox is
currently selected? toggling is
easy, but a bit pointless if you
don't know the initial state!
---------------------------------------------------------------------
A #1: You should send "+" (for
enabling) or "-" (disable) to the checkbox
instead.
But this is not consistant across
all programs. You should test this
with the specific program you are
automating to make sure it works.
-----------------------------------------------------------------------------
Q #2: Is it possible to have a message
window pop up, type a value, then
have that value re-typed when
called? I am building a tool for our
accounts admin to remove all of a
users accounts. I want to try to
prevent them from typing in the user
name value several times.
---------------------------------------------------------------------
A #1: Yes, use a input box and have the
value written (iniwrite) to a file
then when you need the value have it
read in from the file (iniread).
Like this:
inputbox, user, Enter User Name,
What is the user's name?
iniwrite, %user%, c:\\User.ini,
names, username
and then in the other scripts
iniread,
user, c:\\user.ini, names, username
send
%user%
---------------------------------------------------------------------
A #2: If it's all in the same script,
don't bother writing to a file
just do:
inputbox, user, Enter User Name,
What is the user's name?
And later to send it use
send, %user%
-----------------------------------------------------------------------------
Q #3: I need help in taking the input from
an Input Message Box and
whatever the input may be, writing
it as a send command into an
active window. In other words, I
need for a user name and password
to be input by the user and then
write the user input to an existing
application as a send function later
in the script. If anyone has a
script example I would greatly
appreciate it.
---------------------------------------------------------------------
A #1: try this...
; ======= Scriptlet Starts Here =======
InputBox,username,User Name
Entry,\nPlease enter your username
InputBox,password,Password
Entry,\nPlease enter your password,hide
Run,notepad.exe
Winactivate,Untitled - Notepad
Send, Username is: %username%{ENTER}
Send, Password is: %password%
; ======= Scriptlet Ends Here =======
---------------------------------------------------------------------
A #2: Input a value into a variable with
the InputBox, then Send the
variable to the application that
needs it. I've been doing it for a
year or so, and works almost
perfectly; I say ALMOST because every
once in a while the script loses
focus for whatever reason between
the WinActivate command and the
actual Send command, which means
occassionally my Send command sends
output to the desktop.
---------------------------------------------------------------------
A #3: The only thing I've been able to
rely on was to create my own login
screen, capture and send the data as
needed. I've tried spyware and
password capture programs but they
aren't reliable or they're too big
or they're everywhere or they're
something else...
---------------------------------------------------------------------
A #4: Try using something like this:
setenv, WinTitle, <window
title>
setenv, WinText, <window text>
...
setenv, keystrokes, <keystroke
string>
gosub, loop
...
setenv, keystrokes, <next
keystroke string>
gosub, loop
...
...
loop:
; ======= Scriptlet Starts Here
=======
IfWinNotActive,%WinTitle%,%WinText%,Winactivate,%WinTitle%,%WinText%
IfWinNotActive,%WinTitle%,%WinText%,goto,
loop
Send, %keystrokes%
Return
; ======= Scriptlet Ends Here =======