Sign in to follow this  
Followers 0
Berend Jan

set a variable and check it

24 posts in this topic

hi guys,

Im trying to select some text. then put it into a variable so i can check it and run the one or the other code. could you guys check it and say what i am doing wrong. I could be all wrong, im still a big n00b with this :">

This is what i got untill now:

MouseClick ("left", 33, 154, 2)
$Land = Send ("^c")
If $Land = "Verenigde " Then
    MouseClick ("left", 779, 240, 2)
    Send ("^c")
    Mouseclick ("left", 507, 429, 1)
    Send ("^v")
    Mouseclick ("left", 483, 484, 1)
    MouseClick ("left", 808, 481, 1)
ElseIf $Land = "Italie" Then
    SplashTextOn ("bla", "bla", 100, 100, 900, 100)
EndIf

Share this post


Link to post
Share on other sites



quick glance:

Send("^c")

$Land = ClipGet()


Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

Share this post


Link to post
Share on other sites

quick glance:

Send("^c")

$Land = ClipGet()

<{POST_SNAPBACK}>

apparently he doesn't get the copy command right because he's showing what i already had under ctrl c. Is there a other way to put in the clipboard?

Share this post


Link to post
Share on other sites

does anybody have a suggestion to my problem?

BJ

Share this post


Link to post
Share on other sites

does anybody have a suggestion to my problem?

BJ

<{POST_SNAPBACK}>

try putting a sleep between the mouseclick and the ^c ...

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

$Land = Send ("^c")

Send() does not return a value, so this attempt will fail.

Or maybe not?

:)

Share this post


Link to post
Share on other sites

Send() does not return a value, so this attempt will fail.

Or maybe not?

:)

<{POST_SNAPBACK}>

i already adapted that to $Land = ClipGet() and i'll try the sleep between the 2 lines.

Share this post


Link to post
Share on other sites

try putting a sleep between the mouseclick and the ^c ...

<{POST_SNAPBACK}>

no this doesn't work either. :)

Share this post


Link to post
Share on other sites

can you specify how you are testing so we can try it out ?

<{POST_SNAPBACK}>

yeah sure. i let the mouse click on a certain word. the word that should be shown in the msgbox later on. but it still shows something else that i copy and pasted earlier. :)

sleep (2000)
MouseClick ("left", 33, 154, 2)
sleep (500)
Send ("^c")
$Land = ClipGet()

MsgBox(0, "Clipboard contains:", $Land)

Share this post


Link to post
Share on other sites

yeah sure. i let the mouse click on a certain word. the word that should be shown in the msgbox later on. but it still shows something else that i copy and pasted earlier. :)

sleep (2000)
MouseClick ("left", 33, 154, 2)
sleep (500)
Send ("^c")
$Land = ClipGet()

MsgBox(0, "Clipboard contains:", $Land)

<{POST_SNAPBACK}>

Understand this part, but what (dutch/nederlandse) application are you using that you want to select something of ?

Its easiest to try it the same way as you are doing....


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

are you highlighting the word? If I click on ----> THIS once and hit CTRL-C nothing happens, but if I double-click it CTRL-C puts it in the clipboard.

*EDIT I see now that you are trying to double click, but is it working? Is the word highlighted? Can you copy words to the clipboard manually?

Edited by Ejoc

Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

Share this post


Link to post
Share on other sites

Understand this part, but what (dutch/nederlandse) application are you using that you want to select something of ?

Its easiest to try it the same way as you are doing....

<{POST_SNAPBACK}>

im trying to detect in which country i am in a small internet game. just trying out some stuff. so im just trying to copy that word onto the clipboard so i can put it in a variable to start doing the next action on that. im doing it in Mozilla Firefox.

i can also explain in dutch if you like.

Share this post


Link to post
Share on other sites

sleep (2000)
MouseClick ("left", 733, 656, 2)
sleep (500)
Send ("^c")
$Land = ClipGet()

MsgBox(0, "Clipboard contains:", $Land)

Worked perfectly in Firefox for me


Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

Share this post


Link to post
Share on other sites

are you highlighting the word?  If I click on ----> THIS    once and hit CTRL-C nothing happens, but if I double-click it CTRL-C puts it in the clipboard.

*EDIT I see now that you are trying to double click, but is it working?  Is the word highlighted? Can you copy words to the clipboard manually?

<{POST_SNAPBACK}>

yes it's highlighted. and i can copy it manually as well.

Share this post


Link to post
Share on other sites

sleep (2000)
MouseClick ("left", 733, 656, 2)
sleep (500)
Send ("^c")
$Land = ClipGet()

MsgBox(0, "Clipboard contains:", $Land)

Worked perfectly in Firefox for me

<{POST_SNAPBACK}>

:) why not for me. hmmzz... could it be anything on the website that's blocking it?

Share this post


Link to post
Share on other sites

yes it's highlighted. and i can copy it manually as well.

<{POST_SNAPBACK}>

So the Double click selects the text you want but the Send("^c") doesn't put it into the clipboard. even when you put an Sleep(1000) between the 2 statements?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Might want to look into using:

ControlClick()

ControlSend()

WinActivate()


Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

Share this post


Link to post
Share on other sites

So the Double click selects the text you want but the Send("^c") doesn't put it into the clipboard. even when you put an Sleep(1000) between the 2 statements?

<{POST_SNAPBACK}>

yes that is correct. the send ("^c") doesnt put it into the clipboard.

Share this post


Link to post
Share on other sites

yes that is correct. the send ("^c") doesnt put it into the clipboard.

<{POST_SNAPBACK}>

It could be the game blocking it ?

what about Send("^{Insert}") ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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