Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to StringReplace a '\' with AutoHotkey?

Tags:

autohotkey

Trying do do a simple

StringReplace, clipboard, clipboard, \, /, All

That code works w/ other characters, but gives an error with '\' and/or '/' also tried ASCII codes but those do not work either since % is a variable in AHK.

How to StringReplace a '\' with AutoHotkey?

like image 758
This_Is_Fun Avatar asked Apr 07 '26 06:04

This_Is_Fun


1 Answers

I get no error using that line. I used the following snippet to test:

CapsLock & p::
clipboard = are\there\backslashes?
MsgBox, %clipboard%
StringReplace, clipboard, clipboard, \, /, All
MsgBox, %clipboard%
return 

I'm using AutoHotKey 1.0.46.1 (which is probably old by now...) on a Windows XP laptop.

What version are you using?

like image 95
yhw42 Avatar answered Apr 09 '26 20:04

yhw42