Sign in to follow this  
Followers 0
andy5179

Simple Question (Selected Text)

10 posts in this topic

I need to compare the value of the text selected to a predefined value. How do I tell Autoit that I'm wating to read the contents of the selected text??

I have it setup where AutoIt will tab into the field, so it's already all selected...

Thanks!

Share this post


Link to post
Share on other sites



I need to compare the value of the text selected to a predefined value. How do I tell Autoit that I'm wating to read the contents of the selected text??

I have it setup where AutoIt will tab into the field, so it's already all selected...

Thanks!

I require more information. What is the controle you are using? What text is being selected? Where is it being selected? There is no general getselectedtext function that works for everything however there are specific solutions. Please reply with more detailed informations.

Share this post


Link to post
Share on other sites

I require more information. What is the controle you are using? What text is being selected? Where is it being selected? There is no general getselectedtext function that works for everything however there are specific solutions. Please reply with more detailed informations.

I'm automating a bunch of keystrokes in a VB program..

In the form, I use the click mouse function to click to a location, then tab to the next field. At this point, there's some highlighted text in a textbox. I need a way of checking to see if the text that's there matches a predefined value.

Hope this makes sense.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I'm automating a bunch of keystrokes in a VB program..

In the form, I use the click mouse function to click to a location, then tab to the next field. At this point, there's some highlighted text in a textbox. I need a way of checking to see if the text that's there matches a predefined value.

Hope this makes sense.

Ideally you find the proper controlname (can use Autoit_info (AU3Info.exe) program for that if you don't know it yet) and retrieve the text with ControlGetText(). If that's not possible you can send Ctrl+C and do a ClipGet() to retrieve the selected info from the clipboard... Edited by JdeB

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

Ideally you find the proper controlname (can use Autoit_info (AU3Info.exe) program for that if you don't know it yet) and retrieve the text with ControlGetText(). If that's not possible you can send Ctrl+C and do a ClipGet() to retrieve the selected info from the clipboard...

I thought of the Control C to copy it to the clipboard, but what's the command to clear the contents of the clipboard? Sometimes this field has no data in it, so the next copy isn't written over with a blank, but retains the previous record's information.

Share this post


Link to post
Share on other sites

Try reading the help file

example:

ClipGet

--------------------------------------------------------------------------------

Retrieves text from the clipboard.

etc etec etc

and then

Related

ClipPut

always try looking at related

"But clipput is not clear"

Thats right but just put empty string in there.

like Clipput("")

Share this post


Link to post
Share on other sites

Try reading the help file

example:

ClipGet

--------------------------------------------------------------------------------

Retrieves text from the clipboard.

etc etec etc

and then

Related

ClipPut

always try looking at related

"But clipput is not clear"

Thats right but just put empty string in there.

like Clipput("")

Will using "Clipput" empty the contents of the Clipboard?

Share this post


Link to post
Share on other sites

It will set the clipboard's contents to the value that you specify. So if you specify a blank value like ""...

Share this post


Link to post
Share on other sites

It will set the clipboard's contents to the value that you specify. So if you specify a blank value like ""...

O.M.G.

AWESOME!

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

The world is great isn't it ;)

Edited by MrSpacely

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