Brendan Posted July 6, 2011 Posted July 6, 2011 Hi all, Just having a problem getting (what seems to be) a simple little script to work. It is part of a bigger project but this is the part I'm stalling on. #include <IE.au3> $oIE = _IECreate('http://www.autoitscript.com') _IEAction($oIE, "selectall") _IEAction($oIE, "copy") _IEQuit($oIE) Everything seems to work, the copy line even returns a 1 for success when run. Yet the clipboard remains unchanged. Is this code copying something else other than the entire contents of the webpage? I have tried replacing it with send("^c") but this doesn't work in my main project, which I suspect is because I have it running largely in the background. (I would prefer not to have to use ^c in any case, but I could be persuaded otherwise if it really is in my best interests to do so. So any advice?
Jury Posted July 8, 2011 Posted July 8, 2011 Hmmm you code as is works a treat for me - copies all the text from http://www.autoitscript.com starting with: HomeAutoIt»OverviewDownloadsGraphicsOnline DocumentationAutoIt Editor»OverviewDownloadsCVSWrapperAutoIt Tools»OverviewLogoff ScreensaverGImageXVDI OptimizerCodeForumBlogContactsearchAutoIt Automation and Scripting Language AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages. AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box. -- down to: From the Blog AutoIt Consulting Deployment Blog PostsPosted by Jonathan Bennett on May 10, 2011 AutoIt Tools: Logoff Screensaver AddedPosted by Jonathan Bennett on Jan 30, 2011 AutoIt Script Editor Updates – 19th November, 2010Posted by Jonathan Bennett on Nov 21, 2010 Terms - Privacy©1999-2011 Jonathan Bennett & AutoIt Consulting Ltd
DaleHohm Posted July 8, 2011 Posted July 8, 2011 Probably security related. IE9, Win 7, I get a popup asking if I want to allow the application to access the clipboard. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
Brendan Posted July 10, 2011 Author Posted July 10, 2011 (edited) Yeah i used to get that popup, but changed my ie settings to not prompt me anymore, though on reflection I should probably double check whether or not that is simply disabling it. On that note is there a similar way of using these commands with a different browser? Pasting text from IE into Excel seems to take significantly longer than pasting it from Chrome. EDIT: Ok now I feel silly, it turns out my way of getting rid of that prompt was to disable programmatic clipboard access. Though to me this would suggest I'm just disabling the webpages ability to access my clipboard. However I'll be the first to admit I don't know exactly how these things work. Outright enabling it fixed things right up though. If anyone has an answer to my second question that would really be appreciated, would speed things up considerably. Edited July 10, 2011 by Brendan
somdcomputerguy Posted July 10, 2011 Posted July 10, 2011 (edited) On 7/10/2011 at 12:11 PM, 'Brendan said: On that note is there a similar way of using these commands with a different browser? Pasting text from IE into Excel seems to take significantly longer than pasting it from Chrome.There is FF.au3, a Firefox UDF, in the Example Scripts forum. I don't know for sure if it handles 'select all' and 'copy', it probably does, but the syntax may be different.<br><br>edit: there is an Opera UDF there also.<br> Edited July 10, 2011 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Brendan Posted July 11, 2011 Author Posted July 11, 2011 Was hoping for a Chrome one as I already use that, but I'll check those other ones out too. Thanks for the reply!
somdcomputerguy Posted July 11, 2011 Posted July 11, 2011 You bet. Good luck! - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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