Jump to content

Passing Text to a Variable


Recommended Posts

Hello everyone,

First of thank you to all your help i know this is my first post but i have been reading these forms forever and have learn t so much along the way.

I have been building a program that creates multiple tabs and navigates through a web page and preforms upgrades on devices.

And it has been running very well however i have come to the stage where i am adding in error checking.

My goal is the select some text within the webpage and if it matches preform A if not preform B

That part i am okay with ill use an if and else statement with a True.

What i am having trouble with is how i am going to capture the variable on the webpage.

I was thinking something like a

controlclick to highlight the field then a clipget or something and pass it to a local $collecteddata (this is what i am unsure of how to do)

Then define the criteria i want to match $sampledata

if $collecteddata = $sampledata then

msgbox(64,"Data is a match",Data is a match")

else

msgbox(64,"Data is not a match",Data is not a match")

endif

So my questions are.

How can i collect some plain text and define it in my program.

And how can i validate my text against a variable i have defined.

The data i will be collecting is V6 or V5 however i can just make it 6 or 5 if the letter will make it harder.

Thanks everyone

Link to comment
Share on other sites

:guitar: Fit this in your brain that ControlClick, ControlGetText and any other GUI commands are not gonna work for web-pages, if you use IE, then use IE.au3 commands. For Firefox, use ff.au3 commands. This is all I have to say...

Regards,

MKISH

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

:bye: Hey there, was I helpful?

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

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

lol should have checked back to this post this is what i cam up with

Local $bak = ClipGet()

Local $Result = String("value")

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

If $bak = $Result Then

MsgBox(64,"","Matched !")

Else

MsgBox(64,"","Didn't match..")

EndIf

Link to comment
Share on other sites

So, I believe you did Ctrl-A Ctrl-C approach to copy plain text. Well a simple suggestion: Even if you don't use the String() command, it will be fine (it will reduce about 7 bytes of code)

HaHaHa!!!

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

:bye: Hey there, was I helpful?

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

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...