Sign in to follow this  
Followers 0
pokwuk

Newbie Help

9 posts in this topic

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 :unsure:

also still didnt managed to work with $filewrite at the specific location , not sure if the _stringbetween might be applicable.

Kind Regards

Share this post


Link to post
Share on other sites



_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.

Share this post


Link to post
Share on other sites

_StringBetween returns an array

So do i have to include Array.au3 and add something ?

Share this post


Link to post
Share on other sites

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 here
RegExp tutorial: enough to get started
PCRE 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)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Use ClipPut( $result[0] )

ClipPut($result[0])

ClipPut($result^ ERROR

>Exit code: 1 Time: 3.318

Seems it didnt work :unsure:

Share this post


Link to post
Share on other sites

ClipPut($result[0])

ClipPut($result^ ERROR

>Exit code: 1 Time: 3.318

Seems it didnt work :unsure:

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.

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by Jayson

Share this post


Link to post
Share on other sites

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 :unsure:

Thanks

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0