Sign in to follow this  
Followers 0
Maxvan1

Noob Questions

3 posts in this topic

Couple questions...

How do I say ctrl+C and ctrl+V (hotkeys for copy and paste)??

How can I set the state of firefox to SHOW when the title of the page is always changing??? (Ie if I am at google the title is "google - mozilla firefox" but if I am at yahoo it is "yahoo - mozilla firefox") I need to be switching between two screens back and forth...

Basically what I am trying to do is have a list of keywords (list is compiled in a notepad document) that are searched in google and then the number of search results is copied and pasted next to the keyword that was searched...

I dont know if I was clear about that so I will give an example...

________________________________________________________________________

*here is my notepad document- keywords are entered with one space in between*

keyword1

keyword2

keyword3

________________________________________________________________________

I want to copy keyword1 and paste it into google search and press enter.

next I want to copy the number of results and switch back to my notepad document and paste that number of results next to my keyword

after that I want to start the process over with keyword number 2... repeat... keyword 3... repeat... and so on...

Not sure if that made any sense at all?

MY MSN NAME IS maxvan1@gmail.com

Thanks,

Max

Share this post


Link to post
Share on other sites



First of all, what code do you have?

Second, did you bother to read/search the helpfile and forum?

Third,

How do I say ctrl+C and ctrl+V (hotkeys for copy and paste)??

You probably want:

ClipGet() (copy to clipboard)

ClipPut() (copy from clipboard)


My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Share this post


Link to post
Share on other sites

Couple questions...

How do I say ctrl+C and ctrl+V (hotkeys for copy and paste)??

How can I set the state of firefox to SHOW when the title of the page is always changing??? (Ie if I am at google the title is "google - mozilla firefox" but if I am at yahoo it is "yahoo - mozilla firefox") I need to be switching between two screens back and forth...

Basically what I am trying to do is have a list of keywords (list is compiled in a notepad document) that are searched in google and then the number of search results is copied and pasted next to the keyword that was searched...

I dont know if I was clear about that so I will give an example...

________________________________________________________________________

*here is my notepad document- keywords are entered with one space in between*

keyword1

keyword2

keyword3

________________________________________________________________________

I want to copy keyword1 and paste it into google search and press enter.

next I want to copy the number of results and switch back to my notepad document and paste that number of results next to my keyword

after that I want to start the process over with keyword number 2... repeat... keyword 3... repeat... and so on...

Max

As TriBlade said, the commands to put and get from ClipBoard can be used to simulate COntrol-V and Control-C behavior. Or you can literally send a control C with the send command SEND("{^C}")

But that isn't what you said you wanted to do. Control C and V really don't enter in to it from what you describe.

In fact, I am not sure how you are planning to do that in notepad at all, but...

First you want to read your notepad text string -- plenty of examples show how to do that.

Then, you will want to process what you read, looking for your keywords. If you can control what is in the notepad, you will be better off if you separate your keywords with a delimiter (such as a '|' or something) because then you can use the string function SPLIT to break up your long notepad string into smaller strings of your keywords.

Then you use that information in the part of your script that accesses your browser (again there are examples for this) and does the google search. You will need to then grab the text of your google results screen by ControlGetText() and put it another large string.

Then you will put that string into your notepad.

You won't be using Control C and V, probably, you will be processing strings that you grab from the screens.

Here is a code snippet of a routine I wrote which does some of the things you describe.

I am hitting a search screen that has performed a license plate read, and I want to do a different search on the Model which is returned. The search screen is not formatted nicely, so I have to find the MODEL: substring, which is what I want, and the MAKE: substring which shows me the end of what I want. Then I have the keyword I want to search on. (It's hard to read here because all white space is trimmed in my code snippet... I find that makes readin code hard. You might want to cut and paste it into your editor. It won't run, because you don't have the other things around it, but at keast you can view it and understand it)

; Get results from Query

$retString = ControlGetText("FFD Application", "", "[CLASS:WindowsForms10.EDIT.app.0.378734a; INSTANCE:14]") ; NCIC Query Results

$len = StringLen($retString)

;*************************************

; Found something. Process the String

;*************************************

if ($len > 11) Then

$location = StringInStr($retString, "Make:",0,1)

$endModel = StringInStr($retString, "Model",0,1)

$begModel = $location + 6 ; get rid of "Make:" part

$endModel -= 2 ; get rid of RETURN and LF

$cntModel = $endModel - $begModel

if ($location > 0) Then

$keyword = StringMid($retString, $begModel, $cntModel)

Else

$keyword = "ERROR"

EndIf

Else

Exit(1)

EndIf

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