Sign in to follow this  
Followers 0
E1M1

/AutoIt3ExecuteScript problem

6 posts in this topic

#1 ·  Posted (edited)

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 this post


Link to post
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 this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

ok tnx


edited

Share this post


Link to post
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]

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