/AutoIt3ExecuteScript problem

Recommended Posts

Hi I am getting error if I use /AutoIt3ExecuteScript to run my script ConsoleWriteLine("Hello World")

In my au3 script I have line

ConsoleWriteLine("Hello World")
and in my compiled exe file I have:

Func ConsoleWriteLine($sData) ;~ ConsoleWrite($sData & @CRLF)
If $output = "window" Then _GUICtrlEdit_AppendText($edit, $sData & @CRLF) Return ElseIf$output = "-1" Then
Return
Else
FileWrite($output,$sData & @CRLF)
EndIf
EndFunc   ;==>ConsoleWriteLine

And If I try run It I see msgbox says.

Line 5  (File "C:\Documents and Settings\rain\Local Settings\Temp\plugins.au3"):

ConsoleWriteLine("Hello World")
^ ERROR

Error: Unknown function name.

How to fix this function?

if I have Func ConsoleWriteLine(\$sData) in my *.exe script then how to use ConsoleWriteLine("Hello World") in script I want to use with /AutoIt3ExecuteScript?

Edited by E1M1

edited

Share on other sites

You can't as you start a total new instance of AutoIt3.

Live for the present,
Dream of the future,
Learn from the past.

Share on other sites

Is there any other way to use in au3 ConsoleWriteLine("Hello World") than coding it in new au3? Just asking it cuz I want to keep that au3 I use with /AutoIt3ExecuteScript clean and short as possible.

edited

Share on other sites

The function plus the additional udf code must reside within the script you are attempting to call with /AutoExecutScript for the reasons already dictated.

Ed:

What you are suggesting would be a very nice idea (in any implementable form), perhaps it will be at the ass end of someones todolist one day (given what has already been achieved with the format) who knows.

Edited by Mobius

ok tnx

edited

Share on other sites

Is there any other way to use in au3 ConsoleWriteLine("Hello World") than coding it in new au3? Just asking it cuz I want to keep that au3 I use with /AutoIt3ExecuteScript clean and short as possible.

One way to accomplish this would be to put the functions in another file and #include it in each script.

#include "path\to\your_library.au3"
ConsoleWriteLine("Hello World")

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Create an account

Register a new account