Jump to content

Recommended Posts

Posted

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

Posted
Posted

Hi,

Thank you for your reply. I have had a look at that post and at the code, but cannot see where there is a variable being added to a url.. Am I missing something?

Many Thanks

Ian

Posted

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

Posted

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?

♡♡♡

.

eMyvnE

Posted (edited)

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
Posted

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

Ian

Question is what are you copying when sending ctrl + c? Obviously nothing (you need to make a selection before performing that action).

♡♡♡

.

eMyvnE

Posted

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

Posted

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

Posted

Try this one

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)

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
×
×
  • Create New...