Page 1 of 1

escaping special character ::///::<!--

Posted: 11 Mar 2018, 17:18
by partof
Hi, sorry for the dumb question but I can't find an answer:

I want to ahk to automatically change /// into <!--

I tried

Code: Select all

::`/`/`/::`<!--
Any idea ?

Re: escaping special character ::///::<!--

Posted: 11 Mar 2018, 17:23
by BoBo

Code: Select all

::///::
   SendRaw, <!--
   Return
Not tested.

Re: escaping special character ::///::<!--

Posted: 11 Mar 2018, 17:27
by partof
it doesn't work

Re: escaping special character ::///::<!--

Posted: 11 Mar 2018, 18:02
by jeeswg
Perhaps this:

Code: Select all

:*?:///::{Raw}<!--
You may like to look at the hotstring options, sometimes * and ? are/aren't desirable.
Hotstrings and Auto-replace (similar to AutoText and AutoCorrect)
https://autohotkey.com/docs/Hotstrings.htm

Re: escaping special character ::///::<!--

Posted: 11 Mar 2018, 18:03
by gregster
It doesn't work in which context? It seems to work for me.
You can use

Code: Select all

:T:///::<!--
in AHK 1.1.27+

Re: escaping special character ::///::<!--

Posted: 12 Mar 2018, 03:40
by gregster
gregster wrote:It doesn't work in which context?
In which programs? Not even notepad? And if you run the script as admin?
Which AHK version do you use? Which windows version?

Re: escaping special character ::///::<!--

Posted: 12 Mar 2018, 08:52
by partof
sorry for the delay: I'm running the last version of ahk. No it doesn't work on notepad. I believe it's a forbidden characters '/' issue

Re: escaping special character ::///::<!--

Posted: 12 Mar 2018, 09:03
by gregster
Yes, sure, I tried them all. Bobo's, jeeswg's and my version all work (a bit differently, but still). So it cannot be a "forbidden character" thing. But even this works for me on AHK 1.1.27+:

Code: Select all

::`/`/`/::{text}<!--

if you insist on escaping /... do other hostrings work for you? What about running as admin?

Re: escaping special character ::///::<!--

Posted: 12 Mar 2018, 16:10
by partof
thanks for your help, I'm on the version 1.1.28.00, I tried to run the script by admin.

It doesn't work* (actually it's even weirder, :T:///::<!-- worked, but only once).

But I gave up, I found another solution.