Jump to content

/AutoIt3ExecuteScript problem


E1M1
 Share

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

Link to comment
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

wtfpl-badge-1.png

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...