Use of the ` character

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
DavidVM
Posts: 2
Joined: 16 Feb 2018, 18:13

Use of the ` character

16 Feb 2018, 18:30

I am new to AutoHotKey and I am struggling to understand the use of the ` characters in the following example code I have been using:

!c::
SetTitleMatchMode, 2 ; Substring match
WinMenuSelectItem, Lightroom,, File, Plug-in Extras, ` ` ` Presets
Return


This works perfectly - but the use of the ``` characters is the part of the code I do not understand. I have searched the online documentation and can not find an explanation.

Any help would be most appreciated
User avatar
Masonjar13
Posts: 1555
Joined: 20 Jul 2014, 10:16
Location: Не Россия
Contact:

Re: Use of the ` character

16 Feb 2018, 18:53

That's the escape character. It has a number of uses, such as when you need to insert a new-line (`n), a return-carriage (`r), or if you need to state ` as a literal (``). Typically, spaces before the first non-space character in a parameter that uses traditional syntax isn't acknowledged. So it looks like it's using the escape character to insert 3 spaces prior to the work "Presets," so it acts on " Presets" rather than "Presets." Whether or not that's actually needed, I have no idea, because I don't use Lightroom. You could try removing them. Alternatively, you can make it more consistent by using expression syntax: WinMenuSelectItem, Lightroom,, File, Plug-in Extras,% " Presets". When a percent sign is the first (or second, if you want to put a space before it) character in a parameter that's typically traditional, it will use expression instead, so you can state a literal string like that.

Edit: looks like using more than one consecutive space here doesn't work either :lol:
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build
DavidVM
Posts: 2
Joined: 16 Feb 2018, 18:13

Re: Use of the ` character

17 Feb 2018, 13:29

Many thanks for that helpful advice. I now understand the use of the ` character and it's use to represent a space.

I also tested your suggestion of using % " Preset" - where I included three spaces between " and P - that worked fine for me.

Thank you - much appreciated.

David

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 284 guests