Jump to content

Variable in url from Clipboard


jjump
 Share

Recommended Posts

I am trying to add a variable to a url which has been copied to the clipboard. So far, I have the following code, but it does not seem to be working..

CODE

Sleep(10)

Send("^c")

$Keyword = ClipGet()

$url = ("http://www.google.co.uk/products?q=" & $Keyword & "&btnG=Search+Products&hl=en")

Can anyone help?

Many Thanks

Ian

Link to comment
Share on other sites

Link to comment
Share on other sites

Well, when I paste the url that the code gives, it has everything around the variable, just not the $Keyword in the middle of it..

Ian

Something else causes your problem.

Check this:

ClipPut("cat")

$Keyword = ClipGet()
$url = "http://www.google.co.uk/products?q=" & $Keyword & "&btnG=Search+Products&hl=en"

ClipPut($url)

Paste to address bar of your browser after running that script and see if it's ok?

Link to comment
Share on other sites

Something else causes your problem.

Check this:

ClipPut("cat")

$Keyword = ClipGet()
$url = "http://www.google.co.uk/products?q=" & $Keyword & "&btnG=Search+Products&hl=en"

ClipPut($url)

Paste to address bar of your browser after running that script and see if it's ok?

Yep, that works fine.. So, it is only when it sends the ctrl + c to copy that it is not working?

Ian

Edited by jjump
Link to comment
Share on other sites

I have the code like:

CODE

Opt ("WinTitleMatchMode", 2)

WinActivate("Rank", "")

Sleep(10)

Send("^c")

$Keyword = ClipGet()

$url = ("http://www.google.co.uk/products?q=" & $Keyword & "&btnG=Search+Products&hl=en")

ClipPut($url)

This just gives the first thing that was copied from "Rank" and not the url...

Ian

Link to comment
Share on other sites

Ok, found the cure now.. Silly me, I guess script was moving to fast for it, slowed things down and it seems to work fine;

CODE

Opt ("WinTitleMatchMode", 2)

WinActivate("Rank", "")

Sleep(10)

Send("^c")

Sleep(100)

$Keyword = ClipGet()

Sleep(100)

$url = ("http://www.google.co.uk/products?q=" & $Keyword & "&btnG=Search+Products&hl=en")

Sleep(100)

ClipPut($url)

Ian

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...