coronatuss Posted September 24, 2019 Share Posted September 24, 2019 Hello, I'm new to Autoit Forum and I'm a little lost. I would like to know if it is possible to design a Script capable of observing and detecting updates within a specific folder or directory of windows, both new files and old updated files. Once the file is detected, it should be opened on the desktop. Many thanks! Link to comment Share on other sites More sharing options...
coronatuss Posted September 24, 2019 Author Share Posted September 24, 2019 Hello, I'm new to Autoit Forum and I'm a little lost. I would like to know if it is possible to design a Script capable of observing and detecting updates within a specific folder or directory of windows, both new files and old updated files. Once the file is detected, it should be opened on the desktop. Many thanks! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 24, 2019 Moderators Share Posted September 24, 2019 @coronatuss two posts, and both in the wrong forum. Please pay attention to where you post, and stick to a single thread: spamming the forum will not get you help any faster. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
seadoggie01 Posted September 24, 2019 Share Posted September 24, 2019 In .Net there is a FileSystemWatcher object that we use for this. If I remember correctly, however, it can't be used in AutoIt, so you might consider a .Net language. That being said... it would be cool to make an AutoIt wrapper for it, but I'm not sure if it would be possible/feasible. As for doing this in pure AutoIt, I can't think of a great way to detect updates to files... maybe you can use something like this... Local $asOldFileList Local $asNewFileList ; Get the list of files in the directory $asOldFileList = _FileListToArray($yourPath) While True ; Wait a bit, you probs don't need these to open instantly Sleep(500) ; Get the current list of Files $asNewFileList = _FileListToArray($yourPath) ; Check that the arrays match and open all differences ;~ <Some code> ; Keep the current list as the old one $asOldFileList = $asNewFileList If $someExitCondition Then ExitLoop WEnd (This code isn't tested, doesn't work, and is intended as a framework of sorts ) All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
coronatuss Posted September 25, 2019 Author Share Posted September 25, 2019 Thanks @seadoggie01. I will work with the code provided. It can work Link to comment Share on other sites More sharing options...
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