AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how do i send the % key without autohotkey thinking var

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
dwaynek



Joined: 20 Dec 2005
Posts: 39

PostPosted: Thu Aug 09, 2007 7:36 pm    Post subject: how do i send the % key without autohotkey thinking var Reply with quote

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
View user's profile Send private message
wOxxOm



Joined: 09 Feb 2006
Posts: 320

PostPosted: Thu Aug 09, 2007 7:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Thu Aug 09, 2007 8:12 pm    Post subject: Reply with quote

`% 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
View user's profile Send private message Visit poster's website
Superfraggle



Joined: 02 Nov 2004
Posts: 970
Location: London, UK

PostPosted: Thu Aug 09, 2007 9:28 pm    Post subject: Reply with quote

stringreplace the % with `%
_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle
Back to top
View user's profile Send private message MSN Messenger
dwaynek



Joined: 20 Dec 2005
Posts: 39

PostPosted: Thu Aug 09, 2007 9:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Thu Aug 09, 2007 10:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
dwaynek



Joined: 20 Dec 2005
Posts: 39

PostPosted: Thu Aug 09, 2007 10:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Thu Aug 09, 2007 10:48 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
dwaynek



Joined: 20 Dec 2005
Posts: 39

PostPosted: Sun Aug 12, 2007 9:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group