Sign in to follow this  
Followers 0
Melloware

Pass Entire Script to DLL

5 posts in this topic

Sorry for the cross post, just figured someone in this group might have an answer or some insight on my feature request....

I just stumbled upon AutoIT and it looks great. I want to use the AutoItX DLL from an application however one thing that seems to be missing from the API is the ability to pass a String as a whole script and have it execute. So to explain, in my application I would have a TextArea where a user could enter a whole script to execute like:

Run("notepad.exe")

WinWaitActive("Untitled - Notepad")

Send("This is some text.")

I would call AU3.executeScript(String); method of the DLL passing it the above text as a String parameter and the entire script would execute.

Basically it would just be a gateway for the exact functionality you have already built into AutoIT to run scripts.

This would be huge feature for me and I am sure many other future users.

Also I would be more than willing to donate a Delphi .pas translation of the DLL header when its complete if no one already has?

Thanks,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Melloware Inc.

www.melloware.com

=-=-=-=-=-=-=-=-=-=-=-=-=-=-


----------------------------------------------------------------------------------------Melloware Inchttp://www.melloware.comHome of Intelliremote, take back control of your HTPC!www.intelliremote.com-----------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites



Sorry for the cross post, just figured someone in this group might have an answer or some insight on my feature request....

I just stumbled upon AutoIT and it looks great. I want to use the AutoItX DLL from an application however one thing that seems to be missing from the API is the ability to pass a String as a whole script and have it execute. So to explain, in my application I would have a TextArea where a user could enter a whole script to execute like:

Run("notepad.exe")

WinWaitActive("Untitled - Notepad")

Send("This is some text.")

I would call AU3.executeScript(String); method of the DLL passing it the above text as a String parameter and the entire script would execute.

Basically it would just be a gateway for the exact functionality you have already built into AutoIT to run scripts.

This would be huge feature for me and I am sure many other future users.

Also I would be more than willing to donate a Delphi .pas translation of the DLL header when its complete if no one already has?

Thanks,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Melloware Inc.

www.melloware.com

=-=-=-=-=-=-=-=-=-=-=-=-=-=-

That doesn't make much sense for a DLL call.

Anyway, you could always ship one of your AutoIt exe's and pass the script sort of like (pseudo code):

$edit = GUICtrlCreateEdit(...)
...
...
FileWrite(myfiletopass.txt, GUICtrlRead($edit))
Run("myAutoItExeLocationAndName.exe /AutoItExecuteScript " & "myfiletopass.txt", "", @SW_HIDE)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

That doesn't make much sense for a DLL call.

Anyway, you could always ship one of your AutoIt exe's and pass the script sort of like (pseudo code):

$edit = GUICtrlCreateEdit(...)
...
...
FileWrite(myfiletopass.txt, GUICtrlRead($edit))
Run("myAutoItExeLocationAndName.exe /AutoItExecuteScript " & "myfiletopass.txt", "", @SW_HIDE)
Thanks for your quick response.

While I could call the EXE and pass it a script that would be really heavyweight since its an Out-Of-Process call to start the exe, run the script, and then terminate the exe. My application will be doing this A LOT. A DLL would be an In-Process call and be less overhead, less startup time, and much more efficient for doing this over and over inside of an application. This seems to be a pretty common request from reading these forums and I can't imagine it would be that difficult to add to the DLL since AutoIt already has code to parse a script and execute each line. Am I wrong?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Melloware Inc.

www.melloware.com

=-=-=-=-=-=-=-=-=-=-=-=-=-=-


----------------------------------------------------------------------------------------Melloware Inchttp://www.melloware.comHome of Intelliremote, take back control of your HTPC!www.intelliremote.com-----------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Also I would be more than willing to donate a Delphi .pas translation of the DLL header when its complete if no one already has?

I did the same thing -- and then found that TianpengWong had already done it -- Here!

Better, though, is using AutoItX as an Active X object. The calls are simpler and the code all goes into your .exe file.

Share this post


Link to post
Share on other sites

I did the same thing -- and then found that TianpengWong had already done it -- Here!

Better, though, is using AutoItX as an Active X object. The calls are simpler and the code all goes into your .exe file.

I did see that .pas file after I had posted. Good stuff. But back to my original point with a DLL call with a single "executeScript(String)" method. Not only would it allow an in process call but also for future upgrades of AutoIt features, you can just drop a new DLL in and get the new features because the signature of the DLL has not changed. So if my users want the new AutoIT features you need to create a new DLL header and recompile my code to get those features where as an "executeScript" method doesn't change but the underlying DLL containing the code does, you get all the benefit of the new DLL without any changes needed! Its a "separation of responsibility" pattern that I try to employ in all my code.


----------------------------------------------------------------------------------------Melloware Inchttp://www.melloware.comHome of Intelliremote, take back control of your HTPC!www.intelliremote.com-----------------------------------------------------------------------------------------

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