Sign in to follow this  
Followers 0
NegativeNrG

Run Autoit Code In Editbox?

4 posts in this topic

Is it possible to Execute the inputted code in an editbox? aE. Scite's 'Beta Run' will Run the Code in the Editbox.


[size=20]My File Upload[/size]Register at my site and upload.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

yes.

#include <GUIConstants.au3>
dim $EditContents
$Form1 = GUICreate("Edit Box Code", 488, 441, 192, 125)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 473, 377)
$Button1 = GUICtrlCreateButton("Execute Code", 144, 400, 225, 33, 0)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button1
        $EditContents=GuiCtrlRead($Edit1)
        $EditContents=$EditContents&@CRLF
        $handle=FileOpen(@TempDir&"\Code.au3",10)
        FileWrite($handle,$EditContents)
        FileClose($handle)
        sleep(50)
        Run('"'&@ScriptFullPath&'" /AutoIt3ExecuteScript "'&@TempDir&'\Code.Au3"') 
        
    Case Else
;;;;;;;
    EndSelect
WEnd
Exit

Note: this code has to be compiled to exe form before you can use it

One of the nice functions of Autoit is the fact that you can use any compiled exe the same way you can use autoit3.exe

for executing a single line of code, see the "/AutoIt3ExecuteLine" switch in the help file

Edited by death pax

Share this post


Link to post
Share on other sites

Hey, Thanks alot Death. IT Does seem to work.


[size=20]My File Upload[/size]Register at my site and upload.

Share this post


Link to post
Share on other sites

no problem ^.^

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