How to send a literal tilde ~ inside a hotstring? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
yasqueenslay
Posts: 22
Joined: 17 Oct 2019, 05:59

How to send a literal tilde ~ inside a hotstring?

07 May 2021, 03:43

Hi,

I have the following hotstring in an AHK file:

Code: Select all

::pathf::for %A IN ("%PATH:;=" "%") DO @ECHO=%[b]~A[/b] | Find /I "Python"
Problem is that what actually gets written is

Code: Select all

for %A IN ("%PATH:;=" "%") DO @ECHO=%[b]Ã[/b] | Find /I "Python" 
The difference being that ~A turns into Ã. Is there any way to have the end result be with ~A? (so literally the same string as in the hotstring) Is there some sort of escape character I can use? Tried \~A but that didn't do the trick

Thanks!
Last edited by yasqueenslay on 07 May 2021, 04:00, edited 1 time in total.
gregster
Posts: 9023
Joined: 30 Sep 2013, 06:48

Re: How to send a literal tilde ~ inside a hotstring?  Topic is solved

07 May 2021, 03:49

Can't reproduce, but try the Text option (AHK v1.1.27+):

Code: Select all

:T:pathf::for %A IN ("%PATH:;=" "%") DO @ECHO=%~A | Find /I "Python"

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], jeves, Thorlian and 158 guests