Sign in to follow this  
Followers 0
rimmi2002

Getting text from Cliget()

8 posts in this topic

#1 ·  Posted

Hi in my code, I try to select a desired text and then copy it by Sending ^c. (Code below). I want to be able to save this text and search it for substrings. However when I use Clipget() the variable is alway empty. Later in my program I paste the stuff I copied, into a different note, that works fine. Can I please get help with what I am doing wrong?

 

....  
        If pcheck(266, 200, 268, 788, 0x0070C1) Then
                    pcheck(298, $gy, 500, 66, 0x000000)
                    MouseMove(1400, $gy + 1)
                    shiftclick()
                    Sleep(1000)
                    Send("^c")
                    $APData = clipget()
                Else
                    MouseMove(500, 716)
                    shiftclick()
                    Sleep(1000)
                    Send("^c")
                    $APData = clipget()
                EndIf
                
                ....

I would like $APData to be the text that I just copied with ^C command prior. However $APdata ends up empty. Any help would be great. Thanks. 

Share this post


Link to post
Share on other sites



#2 ·  Posted

What application are you trying to interact? There's likely a better way to capture the text than using MouseMove, Send, etc.

Share this post


Link to post
Share on other sites

#3 ·  Posted

@rimmi2002 this works fine for me

WinActivate("Untitled", "")
Sleep(500)
Send("^a")
Send("^c")
Sleep(500)
Send("{ENTER 4}")
Sleep(500)
Send(ClipGet())

However it is a little difficult to offer more in the way of suggestions when you show non-runnable code with a MouseClicks, etc. What app are you trying to automate, and why can you not use Control* commands instead of MouseClicks and Sends, which are woefully unstable?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#4 ·  Posted

Thanks. I figured it out. I guess when doing this:

Send("^c")
 $APData = clipget()

The Clipget() is executed before the text is copied to clipboard, by previous command. Putting a 500ms Sleep in there makes it work just fine. Once I changed the code to below: this worked well.

Send("^c")
 Sleep(500)
 $APData = clipget()

 Thanks for the help. 

Share this post


Link to post
Share on other sites

#5 ·  Posted

2 hours ago, Danp2 said:

What application are you trying to interact? There's likely a better way to capture the text than using MouseMove, Send, etc.

I am interacting with medical software Epic Hyperspace, unfortunately all the "control" commands do not work. Autoit info tool is not able to read any control applets on this app. 

Share this post


Link to post
Share on other sites

#6 ·  Posted

No, for Epic you would need to use IUIAutomation; there is a thread in our Examples forum. I have done some work with it in the past, but no longer have access to it to provide concrete examples.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#7 ·  Posted

@JLogan3o13 Can you elaborate a little on using IUIAutomation with Epic? I am trying to do it right now but I'm finding it a little confusing. Especially because simplespy.au3 seems to just grab the entire Epic window instead of individual elements.


UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Share this post


Link to post
Share on other sites

#8 ·  Posted

I don't know what IUI Automation is. Any chance you can guide me to a tutorial please. 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