Jump to content
Bean07

VBS to Autoit3

Recommended Posts

Bean07

Hi guys

please help me convert my code to autoit

here is the vbs:

Set wshshell = wscript.CreateObject("WScript.Shell")
IID = InputBox("IID")
wscript.sleep 1000
wshshell.sendkeys IID

 

Share this post


Link to post
Share on other sites
spudw2k

A line by line conversion

;Set wshshell = wscript.CreateObject("WScript.Shell")
;Unnecessary as AutoIt has a built-In function to send kestrokes without instantiating a COM object
;IID = InputBox("IID")
$IID = InputBox("","IID")
;wscript.sleep 1000
Sleep(1000)
;wshshell.sendkeys IID
Send($IID)

...however, I don't see the point of this demo?  Prompt for keys, just to send them again?

I assume you have bigger things in mind, so you might learn something more meaningful if you ask for pointers on how to accomplish what you want --end state...the more specific the better.

Also, don't expect the members here (myself included) to just spew out a script for you.  This one was simple enough to convert, but don't be surprised if you are asked to show some initiative in the future.  Your help file and google is your friend.  Notice how similar the commands/context were to convert your code; that information could have easily been found in the help file or searching otherwise.

Good luck and let us know when you get stuck.

Edited by spudw2k

Share this post


Link to post
Share on other sites
Bean07
On 11/1/2017 at 2:48 PM, spudw2k said:

A line by line conversion

;Set wshshell = wscript.CreateObject("WScript.Shell")
;Unnecessary as AutoIt has a built-In function to send kestrokes without instantiating a COM object
;IID = InputBox("IID")
$IID = InputBox("","IID")
;wscript.sleep 1000
Sleep(1000)
;wshshell.sendkeys IID
Send($IID)

...however, I don't see the point of this demo?  Prompt for keys, just to send them again?

I assume you have bigger things in mind, so you might learn something more meaningful if you ask for pointers on how to accomplish what you want --end state...the more specific the better.

Also, don't expect the members here (myself included) to just spew out a script for you.  This one was simple enough to convert, but don't be surprised if you are asked to show some initiative in the future.  Your help file and google is your friend.  Notice how similar the commands/context were to convert your code; that information could have easily been found in the help file or searching otherwise.

Good luck and let us know when you get stuck.

Thank you! :D its worked

Share this post


Link to post
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

×