I have used _Singleton function in my script to restrict only one instance to run.
For testing, I have written below code, and triggered multiple instances.
#include <Misc.au3> MsgBox(0,"",@ScriptName) if _Singleton(@ScriptName, 1) = 0 Then Msgbox(64, @ScriptName, "The program is already running.") Exit Else MsgBox(0,@ScriptName,"No other instances running") EndIf But all are going to else block.
I've made this small UDF to emulate multithreading for AutoIt3.
As we know, AU3 is singlethread and multithreading is only possible through direct ASM. This UDF provides a multithreading emulation through running multiple instances of your script. It also provides an easy way for sending and receiving messages between threads (temporary files are used).
Fork me on Github
I have a script that runs for about 20 seconds.
If Outlook.exe is not already open, and I open it while the script is running, I want Outlook to wait until the script is done, and then open.
Is it possible to set an application in some sort of idle state until the script is done? I want to avoid it from just closing Outlook, and open it again.
I've written a bot that is loading down pictures from a website. Basically, it opens the website, saves the picture via context menu, and hits a button for loading the next pic. Unfortunately, the pics and my internet connection aren't always the same and it takes longer to load at times. Right now I've got a sleep(3000) in my code, but it isn't very efficient. I waste time if it loads faster than 3000ms, and the program fails if it takes more than 3000ms. So I wanted to make a function that waits until the picture has loaded, and then saves it.
I don't know if that causes any problems with possible functions, but it isn't the tab that's loading. The loading circle doesn't appear. It's something on the website.
I've adapted to program to chrome, so I'd have to rewrite it partially for the IE functions, so it'd be nice if there was a solution for chrome. --- Thanks!
Suppose MyProgram is a tabbed program, meaning that it allows for opening multiple files in the same instance.
I want to open File1, File2 and File3 in one instance of MyProgram from an AutoIT script. How can I do this?
I have read the AutoIT Help File about "ShellExecute" and "Run", but I have found nothing helpful.
Thanks for reading my question. Any answer would be very appreciated.