jjump Posted September 10, 2008 Share Posted September 10, 2008 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 More sharing options...
madflame991 Posted September 10, 2008 Share Posted September 10, 2008 CODESleep(10)Send("^c")$Keyword = ClipGet()$url = "http://www.google.co.uk/products?q=" & $Keyword & "&btnG=Search+Products&hl=en"When concatenating more strings you don't need to put them between ()What you're trying to achieve has already been done here http://www.autoitscript.com/forum/index.ph...mp;#entry566540 Game Game Gadget! - read about indie games, gadgets, chiptunes and demoscenesAssembly-like language interpreter and custom machine emulatorSuper Mario Screen Mate - official website or autoit forum pageCogut - Puzzle Game + Editor like sokoban and others Link to comment Share on other sites More sharing options...
jjump Posted September 10, 2008 Author Share Posted September 10, 2008 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 Link to comment Share on other sites More sharing options...
trancexx Posted September 10, 2008 Share Posted September 10, 2008 I don't see a problem. What actually is the problem? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
jjump Posted September 10, 2008 Author Share Posted September 10, 2008 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 Link to comment Share on other sites More sharing options...
trancexx Posted September 10, 2008 Share Posted September 10, 2008 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.. IanSomething 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 Link to comment Share on other sites More sharing options...
jjump Posted September 10, 2008 Author Share Posted September 10, 2008 (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 September 10, 2008 by jjump Link to comment Share on other sites More sharing options...
trancexx Posted September 10, 2008 Share Posted September 10, 2008 Yep, that works fine.. So, it is only when it sends the ctrl + c to copy that it is not working?IanQuestion is what are you copying when sending ctrl + c? Obviously nothing (you need to make a selection before performing that action). ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
jjump Posted September 10, 2008 Author Share Posted September 10, 2008 Hi, The script is copying something, I have tested that part... Ian Link to comment Share on other sites More sharing options...
Pain Posted September 10, 2008 Share Posted September 10, 2008 Your old script didn't had any ClipPUT(), that's why it didn't "worked". Link to comment Share on other sites More sharing options...
jjump Posted September 10, 2008 Author Share Posted September 10, 2008 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 More sharing options...
jjump Posted September 10, 2008 Author Share Posted September 10, 2008 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 More sharing options...
Pain Posted September 10, 2008 Share Posted September 10, 2008 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) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now