drlynch Posted May 15, 2023 Posted May 15, 2023 Hello everyone. I return to the forum to ask a technical question. An example: I have three functions created in AutoIT: a process that creates a restore point, another process that creates a copy of the registry, and another process that looks for a directory to perform a certain action. The question is simple: Does AutoIT perform the execution of processes one by one? That is, until the process of creating the restore point is finished, will it not begin to copy the registry? Is the best option and only option to know if the function finished successfully, is to use @error flag? I've used GUICtrlCreateLabel, so I guess all I would have to do to inform the user that a process is running is right at the end of the process, update the label. Thank you so much.
Developers Jos Posted May 15, 2023 Developers Posted May 15, 2023 AutoIt3 is single threaded, so one one function in the same process will be performed at the time, but when you run() another process, AutoIt3 will not wait for it to finish. So, you will have to provide more details on what the script exactly does to properly answer your question. 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.
ioa747 Posted May 15, 2023 Posted May 15, 2023 If you can't control your tasks with ShellExecuteWait or RunWait then you should check with FileExists , and depending on what you run and what you shout, maybe you need to put a ProcessExists or WinExists for some MsgBox that came out and wants Okay for confirmation and then run the next function (action), etc... If I were you, I would do some tests I know that I know nothing
Lepes Posted May 17, 2023 Posted May 17, 2023 (edited) If you could split those 3 functions into 3 scripts, you could create windows custom messages whenever one of them finish to inform the main one. Eventhough you could use one single script and PostMessage to your own script whenever a function ends if they are asynchonous and you don't know when they will finish. I think you could use "example01" or may be "example02" you don't need to read/understand the nexts examples. WindowsMessages.zipFetching info... Edited May 17, 2023 by Lepes
Skeletor Posted May 17, 2023 Posted May 17, 2023 AutoIt executes processes sequentially, and you can use the @error flag to check for success or failure. To update the GUI and inform the user about the progress, you can create a label and update it using GUICtrlSetData during the process. Depending on what your code is, this can be, for example, every time your array inserts into a new row. If you looking for a way to start all three processes at once (not a great idea as resources would be flatlining) you could create each function as a separate program (Compile an exe) and have a master Program execute all three at one time. You can even store these exe's as a BASE64 file using @UEZ program File to Base64 Running the scripts simultaneously, each process will operate independently, allowing them to execute concurrently rather than one after the other. Keep in mind that if these processes require coordination or synchronization, you may need to implement additional mechanisms or communication methods between the scripts. Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI
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