Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

How to put "%" character in an URL



  • Please log in to reply
9 replies to this topic
rosto
  • Members
  • 130 posts
  • Last active: Jan 06 2016 01:50 PM
  • Joined: 14 Feb 2006
I searched over a hour in this forum and in the Autohotkey documentation to find out how to put a "%" character in an URL without a solution.

p.e.
<!-- m -->http://www.domain.com/s/url=search<!-- m -->%2&keyword=test

Autohotkey gives an error:

Line Text: <!-- m -->http://www.domain.com/s/url=search<!-- m -->%2&keyword=test
Error: The parameter contains a variable name missing its ending percent sign.

Can anyone please help me?

:)

aaffe
  • Members
  • 1045 posts
  • Last active: Jan 16 2014 01:32 PM
  • Joined: 17 May 2007
✓  Best Answer
Use the backtick before the percent-sign:
`%

rosto
  • Members
  • 130 posts
  • Last active: Jan 06 2016 01:50 PM
  • Joined: 14 Feb 2006

Use the backtick before the percent-sign:
`%


It still gives the same error.

Line Text: <!-- m -->http://www.domain.com/s/url=search'<!-- m -->%2&keyword=test
Error: This parameter contains a variable name missing its ending percent sign.

aaffe
  • Members
  • 1045 posts
  • Last active: Jan 16 2014 01:32 PM
  • Joined: 17 May 2007
BACKtick!:
<!-- m -->http://www.domain.com/s/url=search<!-- m -->`%2&keyword=test

rosto
  • Members
  • 130 posts
  • Last active: Jan 06 2016 01:50 PM
  • Joined: 14 Feb 2006

BACKtick!:
<!-- m -->http://www.domain.com/s/url=search<!-- m -->`%2&keyword=test

Thank you aaffe.
That worked.

You know I've never seen such a Backtick.
No backtick on my keyboard.

aaffe
  • Members
  • 1045 posts
  • Last active: Jan 16 2014 01:32 PM
  • Joined: 17 May 2007
The backtick is the escape character in ahk..

  • Guests
  • Last active:
  • Joined: --
This is why I ALWAYS recommend putting stuff in vars...NO NEED TO ESCAPE ANYTHING...

;// *** NOTE *** Bad!...instead of...
;//Run, http://www.domain.com/s/url=search%2&keyword=err msg plz

;// *** NOTE *** Good!...do this...
url:="http://www.domain.com/s/url=search%2&keyword=no err msg plz"
Run, %url%
...notice everything in that line, url (name of var), := (colon equals), " (double quote), anything-except-double-quote (variable's contents/the url), " (double quote)...

The ONLY time that fails is if you want a double quote in your var...which can be handled by Line Continuation...

;// *** NOTE *** Good!...with percent & double quote...
url=
(LTrim %
	http://www.domain.com/s/url=search%2&keyword="double quote me plz"
)
Run, %url%
...notice everything in that sequence, url (name of var), = (equals {no colon this time!}), <Enter> (line break), ( (open paren), LTrim, <Space>, % (percent), <Enter> (line break), <Tab> (just to make it look nice), anything (variable's contents/the url), <Enter> (line break), ) (close paren)...

Yes, I know about backtick, I recommend against it, cuz it makes things look like shit, I also know about "doubling ""up"" the double quotes", that also makes things look like shit...

escapingsucks=wtf `%do`% I have to `%go`% thru to just say 19`%???
escapingsucks:="wtf ""do"" I have to ""go"" thru to just say ""double quote""???"

It still gives the same error.

Line Text: ...search'%2&keyword=test

...what you put there is an apostrophe/single quote, not a backtick...

No backtick on my keyboard.

...backtick is on the same key as tilde, on good keyboards, this is under Esc, left of 1, above Tab, press it, get a backtick: ` :press it with shift get a tilde: ~

If you really don't have backtick, can you tell us which key is located in that spot I mentioned above? (press it while making a post)...or which layout you have...

You could also make an AutoHotkey Script...

;//<key-you-have>::`
F12::`
...I don't really recommend using F12, but pick a key you have, but don't use (whatever is below Esc) & remap it to backtick...

tidbit
  • Administrators
  • 2709 posts
  • Hates playing Janitor
  • Last active: Jan 15 2016 11:37 PM
  • Joined: 09 Mar 2008
backtick is on the ~ key

rawr. be very afraid
*poke*
. Populate the AutoHotkey city. Pointless but somewhat fun. .


rosto
  • Members
  • 130 posts
  • Last active: Jan 06 2016 01:50 PM
  • Joined: 14 Feb 2006

backtick is on the ~ key


On the US keyboard :-)
I have an italian keyboard.
No backtick no tilde.
I use Texter (a text replacement utily) and added the backtick ;)

Tnx.
Rosto

ps: Thank you Guest for your message :-)

  • Guests
  • Last active:
  • Joined: --

I have an italian keyboard.

...ok then...Italian - Keyboard layout - Wikipedia...might I suggest this then (not tested!)...

;// AltGr+Backslash <key left of 1> = Backtick `
<^>!\::`

;// ...or try (comment above, uncomment below)...

;// AltGr+Pipe <key left of 1> = Backtick `
;//<^>!|::`
...by the picture, I'm guessing Backslash is the unshifted key, in any case it might be more reliable to figure out the scancode & use that, than guessing what key it is...