Rocker Posted June 28, 2018 Posted June 28, 2018 I apologize for my poor coding skills, but only on occasion do I have a need to automate a repetitious task to save time. In a nutshell the following code is supposed to go to a website, save the site using Scrapbook (a plugin used by an older version of Firefox), rename the folder in Windows Explorer that Scrapbook assigns a random name for and then moves on to the next website, of which there are hundreds. Everything works, except after the address bar gets populated with the URL, it's like the ENTER key never gets pushed. The weird thing is, this worked yesterday before I left to go home and when I came in this morning it didn't work. The next thing I'll be trying to learn is to loop this with a the list of the websites. Thank you for your help! WinActivate( "[CLASS:MozillaWindowClass]" ) ;Apply focus to the open Mozilla firefox window Sleep(500) Send("^k") ;Apply focus to the address bar Sleep(500) Send("www.WEBSITE.com {ENTER}") ;Send the website to the address bar Sleep(10000) ;Wait for the website to fully open Send("!c") ;Opens the drop down menu for Scrapbook Sleep(2000) Send("{ENTER}") ;Selects the default drop down selection of save Sleep(20000) WinActivate( "[CLASS:CabinetWClass]" ) ;Applies focus to the open Windows Explorer window where the websites are saved Sleep(1000) Send("{SPACE}") ; Selects a folder in the folders list Sleep(200) Send("{HOME}") ;Moves to the top folder Sleep(200) Send("{F2}") ;Keyboard shortcut to rename the folder Sleep(200) Send("www.WEBSITE.com {ENTER}") ;Applies the new name to the folder
xcaliber13 Posted June 28, 2018 Posted June 28, 2018 Rocker, Try breakup the Send command. Send("www.WEBSITE.com") ;Send the website to the address bar Sleep(2000) Send("{ENTER}")
Rocker Posted July 2, 2018 Author Posted July 2, 2018 xcaliber13, Thanks for the reply, I tried your suggestion and unfortunately it did not work, it's as if the code inserts the URL for the webpage and then the address bar looses focus, so the enter command has no effect. Rocker
FrancescoDiMuro Posted July 2, 2018 Posted July 2, 2018 @Rocker Hi and welcome to the AutoIt forum I think there are a bunch of UDFs which will surely cover your needs Just look here. Best Regards. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
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