pokwuk Posted April 29, 2011 Share Posted April 29, 2011 Hi folks , Im trying to learn some basic stuff with autoit, but im struggling with ClipPut and Filewrite. #include <IE.au3> #include <string.au3> $oIE = _IECreate ( "www.google.com" ) sleep (2000) $text = _IEBodyReadText ( $oIE ) $result = _StringBetween ( $text , "Web", "Videos") ClipPut( $result ) So what i wanted to do was copy the "images" to the clipboard and put it a txt. Txt would say , " i was on google and i clicked on $result today to show my freinds. , But apparently its not working also still didnt managed to work with $filewrite at the specific location , not sure if the _stringbetween might be applicable. Kind Regards Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 29, 2011 Moderators Share Posted April 29, 2011 _StringBetween returns an array Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
pokwuk Posted April 29, 2011 Author Share Posted April 29, 2011 _StringBetween returns an arraySo do i have to include Array.au3 and add something ? Link to comment Share on other sites More sharing options...
jchd Posted April 29, 2011 Share Posted April 29, 2011 Use ClipPut( $result[0] ) This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 29, 2011 Moderators Share Posted April 29, 2011 So do i have to include Array.au3 and add something ?Why not take a look at the help file and see the example it uses for _StringBetween() and how to retrieve your data?Then look here on how to actually use/understand arrays.http://www.autoitscript.com/wiki/Arrays Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
pokwuk Posted April 29, 2011 Author Share Posted April 29, 2011 Use ClipPut( $result[0] ) ClipPut($result[0]) ClipPut($result^ ERROR >Exit code: 1 Time: 3.318 Seems it didnt work Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 29, 2011 Moderators Share Posted April 29, 2011 ClipPut($result[0]) ClipPut($result^ ERROR >Exit code: 1 Time: 3.318 Seems it didnt work Again, please read the help file for that function ( or any other function you're going to use ). If it fails, it's because the search for what you're trying to do failed. You'll need to understand how to handle the error. The help file generally shows you how to handle exceptions and it has examples. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Jayson Posted April 29, 2011 Share Posted April 29, 2011 (edited) It works for me with this #include <IE.au3> #include <string.au3> #include <array.au3> $oIE = _IECreate ("www.google.com") sleep (2000) $text = _IEBodyReadText($oIE) $result = _StringBetween($text , "Web", "Videos") ClipPut($result[0]) ConsoleWrite($result[0] & @LF) Edit : Make sure that your google page is in english. I've tried to put it in french or other language and I got the same error as you. Edited April 29, 2011 by Jayson Link to comment Share on other sites More sharing options...
pokwuk Posted April 29, 2011 Author Share Posted April 29, 2011 It works for me with this #include <IE.au3> #include <string.au3> #include <array.au3> $oIE = _IECreate ("www.google.com") sleep (2000) $text = _IEBodyReadText($oIE) $result = _StringBetween($text , "Web", "Videos") ClipPut($result[0]) ConsoleWrite($result[0] & @LF) Edit : Make sure that your google page is in english. I've tried to put it in french and I got the same error as you. I dont know if i had extra spaces or anything .. but that one seems to work here. but there is not big difference Thanks 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