Jump to content
Sign in to follow this  
Medic873

Executing code from input box

Recommended Posts

Medic873

So I have a question I have never needed to cross this bridge but it finally came up at work today. I need to execute some code that is going be inputed from a inputbox. 

 

For example

 

[script]

msgbox("Hello", "Hello");

$code = inputbox("hello", "hello");

;Then right here it would take the variable $code and run its code that was just entered through the input box. Does tamake sense.

[/script]

Share this post


Link to post
Share on other sites
Medic873

Wow never saw that command in the help file.

 

Thanks so much

Share this post


Link to post
Share on other sites
Chimp

Here also another way:

Local $sCommand = InputBox("Execute by '/AutoIt3ExecuteLine'", "Enter one line of AutoIt code", 'MsgBox(0, "hello", "hello")')
$sCommand = '"' & StringReplace($sCommand, '"', '""') & '"'
Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $sCommand)

 


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.