How2 Posted September 20, 2017 Share Posted September 20, 2017 Hi, I am new to scripting so please bear with me. I am hoping you can help me in creating a script that will perform the following. 1. Copy files from source folder to destination folder. 2. Check if the copying of files are finish. After finishing copying those files, randomly open those files from the destination folder. 3. After opening those files, next is to close those files. 4. After closing those files, next is to open MS Outlook. 5. Once MS Outlook is open, next is open IE and go to youtube, then open a second instance of IE and go to yahoo, open third instance of IE and go to msn.com. 6. next is check if the files are close and if yes then delete those files from the destination folders. 7. after deleting all files from destination folders, close MS Outlook and close all IE. 8. The script will go back to step 1 (loop). 9. I have a button to end the script. Thanks in advance for your help. Link to comment Share on other sites More sharing options...
232showtime Posted September 20, 2017 Share Posted September 20, 2017 1. Copy files from source folder to destination folder. read from helpfile FileCopy 2. Check if the copying of files are finish. After finishing copying those files, randomly open those files from the destination folder. read from HelpFile Progressoff/on/set read from HelpFile ShellExecute 3. After opening those files, next is to close those files. read from HelpFile WinClose 4. After closing those files, next is to open MS Outlook. read from HelpFile ShellExecute 5. Once MS Outlook is open, next is open IE and go to youtube, then open a second instance of IE and go to yahoo, open third instance of IE and go to msn.com. read from HelpFile _IE_Example 6. next is check if the files are close and if yes then delete those files from the destination folders. read from HelpFile WinExist, FileDelete 7. after deleting all files from destination folders, close MS Outlook and close all IE. read from HelpFile WinClose 8. The script will go back to step 1 (loop). read from HelpFile While, For, Do 9. I have a button to end the script. HotKeySet - You're good to go... ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
KickStarter15 Posted September 20, 2017 Share Posted September 20, 2017 @How2, In addition, when doing your loop, your CPU will increased up to 40-50% utilization usage or above depending on your loop which might cause of slowing the computer down. So better to add sleep() for your loop and when to exit your loop. HotKeySet("{ESC}", "_Exit") ; Start loop While 1 Sleep() ; your codes here. WEnd Func _Exit() Exit EndFunc Or ; Start loop Do Sleep(1000) ;some code here. Untel $msg = $GUI_EVENT_CLOSE Exit Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare. 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