Jump to content

Insert Text Script


BChat
 Share

Recommended Posts

My OS = Windows Vista Ultimate. I would like to make a script to insert text (ex: user names and passwords) into web pages. I would like to make a shortcut for the script so all I have to do is click the short cut and the text is inserted into the web page.

Can this be done with AutoIt?

This is my 1st experience at this, so I know NOTHING

;-)

Link to comment
Share on other sites

sounds like your looking for a password manager (to put in your login credentials for email or something), i think even ie7 has some kind builtin... (but i think it sucks). i use firefox, i know it has its own, opera has its own last time i used it.

if i missunderstood this then sry, explain it a bit more.

people are anoying, am i? ;) v2.95
Link to comment
Share on other sites

sounds like your looking for a password manager (to put in your login credentials for email or something), i think even ie7 has some kind builtin... (but i think it sucks). i use firefox, i know it has its own, opera has its own last time i used it.

if i missunderstood this then sry, explain it a bit more.

I use IE7 & FF - mostly FF. I would like a script/macro that would type/insert text into a field on a web page. IF I go to www.xxx.com and want to insert my user name - I hit a shortcut and the text is inserted into the field.

Edited by BChat
Link to comment
Share on other sites

Of course it can be done :P And very easily. (Although I believe there's some problems with Vista)

Look in the help file for all the IE functions.

Sure - ''easily'' for you - not so ''easily'' for me. I don't have 3 eyes to see things.

Link to comment
Share on other sites

Could you try this script?

#include <IE.au3>

;Creates an explorer and navigates to the given site
$oIE=_IECreate("https://www.peoplesoft.com/corp/en/login.jsp",1)

$oUser=_IEGetObjByName($oIE,"USER");Gets the username inputbox object
$oPass=_IEGetObjByName($oIE,"PASSWORD");gets the password inputbox object
$oEnter=_IEGetObjByName($oIE,"enter");Gets the enter button object

_IEFormElementSetValue($oUser,"my username");Sets username in the username inputbox
_IEFormElementSetValue($oPass,"mypassword");Sets the password in the password inputbox
_IEAction($oEnter,"click");Clicks on the enter button

Is that what you are trying to do? This will open an internet explorer window, will navigate to that site and will fill in the login form.

Link to comment
Share on other sites

Something like this?

HotKeySet("{F7}","User")
HotKeySet("{F8}","Password")
HotKeySet("{F9}","Message")

$user="my username"
$password="password"
$message="Hello world!"

While 1
    Sleep(100)
WEnd

Func User()
    Send($user)
EndFunc

Func Password()
    Send($password)
EndFunc

Func Message()
    Send($message)
EndFunc

Run the script. Then go to some edit control and press F7 to send username, F8 to send password or F9 to send a message.

Edited by Nahuel
Link to comment
Share on other sites

It's morning, my smartness is still questionable :P

Can I use this function

Send ( "keys" [, flag] )

to insert text?

If I want to insert "BChat", can I replace "keys" with "BChat"?

FWIW, I experimented in both Vista Ultimate and XP Home - I am equally

dumb in both.

Link to comment
Share on other sites

OK, 1 step at a time:

1 - I make a script

Send ( "b" [, 0] )

will that send a b to the field/cell where I have the cursor placed?

Thank you for your continued support.

I am a certified by the State Prison System here in the proper application of leg irons and handcuffs -

should ever need any help in THAT area.

:P

Link to comment
Share on other sites

Just use it like this:

Send("b")

That's the correct syntax. When you see a function description, you'll see sometimes that there are parameters in brackets, like this:

Send ( "b" [, 0] )

They only mean that that parameter is optional, you don't have to type the brackets.

Link to comment
Share on other sites

I do that and when I click on the script short cut, the screen flashes - but no ''b'' shows up.

Somewhere on this computer are a bunch of b's - hiding.

Something is wrong with my process. Thanks for your patience.

FYI - when you apply handcuffs - the double bar side goes on the top of the out stretched arm.

the key hole faces up the arm, away from the hand, and you must be sure to double lock them.

:P

Link to comment
Share on other sites

Well of course, if your script only has: Send("b"), then the 'b' is sent right after you run your script. Try this:

Sleep(5000)
Send("hello there")

Open notepad (or some other program where you can type text in) then run this scrtipt and return to notepad. Make sure you click there so it can type. Sleep(5000) will give you 5 seconds to wait so you can do all that.

Look for Send() in the help file, it has really good examples. Also, look for the Hello World tutorial.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...