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
Use of the ` character
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Use of the ` character
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
Edit: looks like using more than one consecutive space here doesn't work either
Re: Use of the ` character
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
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
Who is online
Users browsing this forum: filipemb, Joey5, ShatterCoder, Xaucy and 187 guests