| View previous topic :: View next topic |
| Author |
Message |
dwaynek
Joined: 20 Dec 2005 Posts: 39
|
Posted: Thu Aug 09, 2007 7:36 pm Post subject: how do i send the % key without autohotkey thinking var |
|
|
i wanna send a long url which has % all over it but autohotkey keeps thinking the % is the start of a variable. instead of having to put ` at every %, is there an easier way?
i thought sendraw would do the job but apparently it only passes through the {} symbols. |
|
| Back to top |
|
 |
wOxxOm
Joined: 09 Feb 2006 Posts: 320
|
Posted: Thu Aug 09, 2007 7:41 pm Post subject: |
|
|
sometimes it is possible to use ControlSetText which is faster - but only suitable for UIs.
quite often I send long texts via clipboard which is imho a lot faster than sendxxx |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Thu Aug 09, 2007 8:12 pm Post subject: |
|
|
`% is the right way to do it. every language has a few chars you can't use directly. %% may also work? I don't remember _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 970 Location: London, UK
|
|
| Back to top |
|
 |
dwaynek
Joined: 20 Dec 2005 Posts: 39
|
Posted: Thu Aug 09, 2007 9:51 pm Post subject: |
|
|
i cant even do a stringreplace because if i do:
| Code: | | stringreplace, url, url, %, `% |
i get:
Error: This parameter contains a variable name missing its ending percent sign.
i cant even define a variable like
url="http://search.ebay.com/search/search.dll?cgiurl=http%3A%2F%2Fcgi.ebay.com%2Fws%2F&fkr=1&from=R8&satitle=%word%&category0="
without erroring out coz when i try to start autohotkey, it boots me out saying:
| Code: | the following variable name contains an illegal character.
"2Fcgi.ebay.com"
the program will exit. |
|
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Thu Aug 09, 2007 10:07 pm Post subject: |
|
|
you have to escape in the stringreplace too:
| Code: |
stringreplace, url, url, `%, ```%
|
this is UNTESTED _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
dwaynek
Joined: 20 Dec 2005 Posts: 39
|
Posted: Thu Aug 09, 2007 10:15 pm Post subject: |
|
|
if the stringreplace line is placed after the url line as in:
| Code: | url="http://search.ebay.com/search/search.dll?cgiurl=http%3A%2F%2Fcgi.ebay.com%2Fws%2F&fkr=1&from=R8&satitle=%word%&category0="
stringreplace, url, url, `%, ```% |
hotkey stops at the url line with error msg and won't proceed.
error msg is:
| Code: | the following variable name contains an illegal character.
"2Fcgi.ebay.com"
the program will exit. |
|
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Thu Aug 09, 2007 10:48 pm Post subject: |
|
|
leave off the "" or use :=
| Code: |
url:="http://search.ebay.com/search/search.dll?cgiurl=http%3A%2F%2Fcgi.ebay.com%2Fws%2F&fkr=1&from=R8&satitle=%word%&category0="
|
*Tested* _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
dwaynek
Joined: 20 Dec 2005 Posts: 39
|
Posted: Sun Aug 12, 2007 9:45 pm Post subject: |
|
|
| awesome, thanks! didn't work at first until i upgraded to the new ver but worked fine after that. thanks again engunneer. |
|
| Back to top |
|
 |
|