Jump to content

Special character with recorded au3 and include file problem

Recommended Posts

I have recorded a gui installation and modified the au3 file as per my requirement.

But the problem is, whenever I try to compile the au3 file, I am getting a special character on top of the file.


Can you suggest how to resolve this as it is appearing everytime during compilation.

And also I am trying to include a au3 file which is separate folder so I am adding the <..\Library.au3> line.

It is able to pick that but in that file "Library.au3" there is a file install line.

FileInstall(".\SendMail.ps1", @ScriptDir & "\SendMail.ps1")

Library.au3 is being used by many other codes in the previous folder..

But the current file is looking for the ps1 file in current folder.

So is there any option to tell the compiler to pick the dependent files relative to Library.au3 instead of the current code.

Link to post
Share on other sites
On ‎2‎/‎13‎/‎2017 at 6:56 PM, Subz said:

What is the .au3 file encoding?

With regards to FileInstall, in your library any reason you can't use an absolute path rather than a relative path for your source?

Because I have synced this with GitHub and the work is not fixed to one machine, as workstations may vary I am keeping everything relative to the sourcecode folder.

May be a silly question, how to check the encoding?

Edited by ur
Link to post
Share on other sites

Does anyone compile library.au3 directly?  Are all scripts in child folders? for example

  • library.au3
  • sendmail.ps1
    • Scripts Sub Folder
    • Script1 to Compile.au3
    • Script2 to Compile.au3

If so you could change the library.au3 to use FileInstall('..\SendMail.au3', @ScriptDir & '\SendMail.au3'), but this all depends on your folder structure, I personally work the other way around for example:

  • Script1 to Compile.au3
  • Script2 to Compile.au3
    • Resources Sub folder
    • library.au3
    • sendmail.ps1
Link to post
Share on other sites

library.au3 is the common one with the team and also for other tools, if any common functionaly one is there, we are saving those to library.au3 so that we can use it for multiple tools and also for future purpose to reduce redundancy.

So it is there in parent folder.

I am able to compile my au3 by including it as "../library.au3".

But the dependent files sendmail.ps1 it is checking in my au3 directory instead of the library.au3 folder.


Link to post
Share on other sites

You could change the library.au3 FileInstall to:

FileInstall("..\SendMail.ps1", @ScriptDir & "\SendMail.ps1")

But that would mean your team would always have to create scripts at the same level as your current script.  Alternatively just remove the FIleInstall from the library leave SendMail.ps1 in the parent folder and then add the line above to your individual scripts.



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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Fr33b0w
      Func z009() If FileExists("search\009\009.au3") Then #include <search\009\009.au3> EndIf EndFunc This wont work...  Is there any workarround for this or I should do it in a different way?
    • By TrashBoat
      How do i add a path to a file in Include.
      I want my script to get the udf in the same folder as the script/exe:
      Include "@ScriptDir/udf.au3" can this be done?
    • By pedrit0
      Hi all.
      I have created an external au3 (a library of functions and vars) that is #included in a main script that i must compile.
      I wish that the content of the library is not merged with the main script when compiling.
      My goal is to keep the ability to modify the library even after the main exe is compiled and that these changes are effective when executing the exe.
      I guess this is not possible using the standard #include method.
      Is there a way to do that ?
      thx a lot :-)
    • By xiantez
      Hey AutoIT Community,
      Just wanted to know if there is a way I can #include all *.au3 files in my script without having to #include each individual .au3 file. For instance, currently I have a laundry list of #includes like this:
      #include <IE.au3>
      #include <Inet.au3>
      #include <AutoItConstants.au3>
      #include <GUIConstantsEx.au3>
      #include <GDIPlus.au3>
      #include <GuiMenu.au3> 
      Would there be a way I could include all of the files above or all  .au3 file in a one liner? That way I do not have to burn up a bunch of lines of code for just my includes.... Your help is greatly appreciated...
    • By MattG1991
      Hello all, 
      I've written a script that pulls info from some web pages, saves the results to variables, and prints it out to a Word document. I've tried to make this script work with a minimum of user interaction. I've noticed an issue happens when I run the script and I have another window set as active, like SciTE for example. It inserts an "ETX" character. I've done this with Notepad too. It displays an upside down L character. Any particular reason why? Unfortunately, I can't post any code. Basically, it gets a collection of tags, applies a test to find the values I want, then pulls the innerhtml from said tag. Then it assigns the results to a global variable.  Any help would be appreciated. 
  • Create New...