Jump to content

Include an au.3 @scriptDir


Recommended Posts

Use

#Include "udf.au3"

The help file explains the search order for <> and ""

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Developers

Why would you expect that to happen?

 Isn't compiling the same as taking the current source and creating a selfcontained executable to you?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Just now, Jos said:

Why would you expect that to happen?

 Isn't compiling the same as taking the current source and creating a selfcontained executable to you?

Jos

I wanted that my script would read the udf that i included and execute functions from there, but now then i  compile it seems just to take the udf read it once and dont update if it has been updated

Link to comment
Share on other sites

#Include is processed during compile time. So you need to re-compile your script for the changes to take effect.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Developers

Yes, but that means you need to run the script each time instead of using a compiled version.
... but why do you need this anyways?   What are you looking for to update in the script?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

10 minutes ago, Jos said:

Yes, but that means you need to run the script each time instead of using a compiled version.
... but why do you need this anyways?   What are you looking for to update in the script?

Jos

im looking to update that udf so the program can read it and recognize the newly typed functions

Link to comment
Share on other sites

  • Developers

That description  is way to vague for me to consider whether there are alternative ways.
So you really need to code script logic and can't get away with an INI file or something?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

14 minutes ago, Jos said:

That description  is way to vague for me to consider whether there are alternative ways.
So you really need to code script logic and can't get away with an INI file or something?

Jos

Think of it like a database that can be updated by the user 

Link to comment
Share on other sites

  • Developers

So you want your users to update the script? ...  then as stated, simply run the script with autoit3.exe.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

So what?  Each compiled script can act as the stub for an script and execute that.

When you want real help you will have to post a real question here with its usecase ..  else I am out.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Options:

Give your users an uncompiled stub that uses functions that your users can edit - distributed with AutoIt. Whether these functions are in includes or not is just a matter of housekeeping. But if compiled you are locked in to whatever the state was at compile time.

Allow your users to edit a flat file / SQLite DB that is read in by your script at run time. Your script can be compiled or not. Limitation, you can execute some AutoIt code like this:

#include <MsgBoxConstants.au3>
Opt('MustDeclareVars', 1)
Global $MyFunc = "MsgBox(4096, 'Test', 'Hello') & MsgBox(4096, 'Test', 'And me')"
Execute($MyFunc)

but you wont be able to do anything much more complex than that without writing your own script parser within your AutoIt script, and that is going to get ugly fast. 

Equally you could write some functions in your script and expose them to users to activate with parameters from a flat file using conditionals, but as Jos says, you would have to post exactly what the use case was for people to advise you appropriately on that.

What it seems to me you are asking for is a compiled program that reads in some more source code and recompiles itself to include that additional source code: That is not going to happen without more pain than just distributing AutoIt in the first place. 

 

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Link to comment
Share on other sites

If a user is able to write custom functions why shouldn't he be able to compile the script himself?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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

×
×
  • Create New...