Sign in to follow this  
Followers 0
Medic873

Executing code from input box

4 posts in this topic

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



Wow never saw that command in the help file.

 

Thanks so much

Share this post


Link to post
Share on other sites

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  
Followers 0