Jump to content
Sign in to follow this  
jjump

Variable in url from Clipboard

Recommended Posts

jjump

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

Share this post


Link to post
Share on other sites
madflame991

Share this post


Link to post
Share on other sites
jjump

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

Share this post


Link to post
Share on other sites
trancexx

I don't see a problem.

What actually is the problem?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
jjump

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

Share this post


Link to post
Share on other sites
trancexx

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

Share this post


Link to post
Share on other sites
jjump

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

Share this post


Link to post
Share on other sites
trancexx

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

Share this post


Link to post
Share on other sites
jjump

Hi,

The script is copying something, I have tested that part...

Ian

Share this post


Link to post
Share on other sites
Pain

Your old script didn't had any ClipPUT(), that's why it didn't "worked".

Share this post


Link to post
Share on other sites
jjump

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

Share this post


Link to post
Share on other sites
jjump

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

Share this post


Link to post
Share on other sites
Pain

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)

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  

×