TrashBoat Posted July 14, 2017 Posted July 14, 2017 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?
water Posted July 14, 2017 Posted July 14, 2017 (edited) Use #Include "udf.au3" The help file explains the search order for <> and "" Edited July 14, 2017 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
TrashBoat Posted July 14, 2017 Author Posted July 14, 2017 Then i compile the script and edit the udf it dosent update
Developers Jos Posted July 14, 2017 Developers Posted July 14, 2017 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.
TrashBoat Posted July 14, 2017 Author Posted July 14, 2017 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
water Posted July 14, 2017 Posted July 14, 2017 #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
Developers Jos Posted July 14, 2017 Developers Posted July 14, 2017 Correct ... and ... does what I stated make sense? 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.
TrashBoat Posted July 14, 2017 Author Posted July 14, 2017 can i make it so it updates somehow? or not?
Developers Jos Posted July 14, 2017 Developers Posted July 14, 2017 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.
TrashBoat Posted July 14, 2017 Author Posted July 14, 2017 My point here is so a user can put his function in the udf.au3 file and save it launch my program and execute it via function name
TrashBoat Posted July 14, 2017 Author Posted July 14, 2017 or maybe there is an easier way of executing another script via a gui of some sorts
TrashBoat Posted July 14, 2017 Author Posted July 14, 2017 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
Developers Jos Posted July 14, 2017 Developers Posted July 14, 2017 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.
TrashBoat Posted July 14, 2017 Author Posted July 14, 2017 well ini files cant store scripts and execute them on command can they? Just tell me a way how to execute another script/compiled version of the script via a gui of sorts
TrashBoat Posted July 14, 2017 Author Posted July 14, 2017 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
Developers Jos Posted July 14, 2017 Developers Posted July 14, 2017 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.
TrashBoat Posted July 14, 2017 Author Posted July 14, 2017 9 minutes ago, Jos said: So you want your users to update the script? ... then as stated, simply run the script with autoit3.exe. Jos but the users wont have autoit installed
Developers Jos Posted July 14, 2017 Developers Posted July 14, 2017 (edited) 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 July 14, 2017 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.
SlackerAl Posted July 14, 2017 Posted July 14, 2017 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.
water Posted July 14, 2017 Posted July 14, 2017 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now