jeeswg's tutorial pages

Helpful script writing tricks and HowTo's
User avatar
jeeswg
Posts: 263
Joined: 19 Dec 2016, 01:58
Location: UK

jeeswg's tutorial pages

04 Jan 2017, 16:49

[updated: 2017-01-19]

I will be posting external links with full AutoHotkey tutorials etc in future,
but until then I will post occasional things here.

For this syntax character guide, please state any omissions,
or make any comments.

==================================================

AUTOHOTKEY SYNTAX: CHARACTER GUIDE

[ANSI (CP-1252) 32-255]
!"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
`abcdefghijklmnopqrstuvwxyz{|}~
€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ
¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß
àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ

(note: ANSI CP-1252 characters 128-159, differ from Unicode characters 128-159)

[USEFUL LINK]
Variables and Expressions
https://autohotkey.com/docs/Variables.htm#Operators

[ASCII CHARACTERS 33-126 MINUS LETTERS/DIGITS][126-32-52-10=32]
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
! NOT, (SendInput: alt)
" assign text
# directives, (SendInput: win)
$ (hotkeys: hook)
% variables (command style), variables (expression style), function names
& address, bitwise-and, && AND
'
( continuation section, if statements, functions, objects
) continuation section, if statements, functions, objects
* multiply, dereference, variadic functions, ** powers, /* comment block start, */ comment block end, (hotkeys: wildcard)
+ add, ++ increment, (SendInput: shift)
, (warning: not decimal point), multi-statement
- subtract, -- decrement
. decimal point, concatenate, objects
/ divide, // floor divide, /* comment block start, */ comment block end
: ?: ternary operator
; comments
< less than, << bit shift left, <> not equal to
= [SEE EQUALS SECTIONS AT BOTTOM]
> greater than, >> bit shift right, <> not equal to
? ?: ternary operator
@
[ objects
\
] objects
^ (warning: not powers), bitwise-exclusive-or, (SendInput: ctrl)
_
` escape sequences
{ code blocks, (SendInput)
| bitwise-or, GUI parameters, || OR
} nested brackets, (SendInput)
~ bitwise-not, (hotkeys: native)

[EQUALS]
:= assign
+= add
-= subtract
*= multiply
/= divide
//= floor divide
.= append
|= bitwise-or
&= bitwise-and
^= bitwise-exclusive-or
>>= bit shift right
<<= bit shift left

[EQUALS][FURTHER USES]
= assign, compare case insensitive
== compare case sensitive
~= RegExMatch
>= greater than or equal to
<= less than or equal to
!= not equal to

[FURTHER USES]
!
" paths (command line parameters), (invalid filename character)
# url fragment identifier, (issue with WB object Navigate)
$
% paths (environment variables), URI
& menu item text
' (Excel VBA single-line comments)
(
)
* FileAppend, Ptr* (PtrP), loop files wildcard, (invalid filename character)
+
, paths (command line parameters+)
-
. (invalid filename character+)
/ (invalid filename character), paths (command line parameters+), // C++ single-line comments
: (invalid filename character)
; ini files (comments)
< (invalid filename character)
= ini files
> (invalid filename character)
? (invalid filename character)
@ email address, reg files (default registry value)
[ ini files (section header)
\ (invalid filename character)
] ini files (section header)
^
_
`
{ CLSIDs
| (invalid filename character), || GuiControl
} CLSIDs
~

invalid filename characters (in a name without a path) (9):
\ / : * ? " < > |
invalid filename characters (in a full path) (7):
/ * ? " < > |
note: chars 1-31 are also invalid dir/name characters
note: file names (minus dirs) cannot start/end in .

Excel VBA type-declaration characters:
integer %, long &, currency @, single !, double #, string $

==================================================

[CHARACTERS THAT SOMETIMES REQUIRE ESCAPING]
! SendInput
" expression style
# SendInput
$
% command style, expression style (AHK v2)
& InputBox
' expression style (AHK v2)
(
) continuation section
*
+ SendInput
, command style, if var contains, if var in
-
.
/
:
; command style, expression style, hotkeys, IniWrite
<
= IniWrite
>
?
@
[ IniWrite
\
]
^ SendInput
_
` command style, expression style, (SendInput/hotstrings)
{ SendInput
|
} SendInput
~

==================================================
wolf_II
Posts: 1070
Joined: 08 Feb 2015, 20:55

Re: jeeswg's tutorial pages

Today, 07:17

jeeswg wrote:note: file names (minus dirs) cannot start/end in .

Are you sure?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
jeeswg
Posts: 263
Joined: 19 Dec 2016, 01:58
Location: UK

Re: jeeswg's tutorial pages

Today, 09:27

Try creating an extensionless file in a folder e.g. 'abc', and renaming to add a dot at the front/end (on Windows 7). Btw AutoHotkey creates files it shouldn't sometimes, including a file it couldn't delete once if I remember back. As a precaution don't create experimental filenames on the Desktop but in a subfolder. It's like renaming a folder to Con, ordinarily it can't be done, but I believe there is a way to force it. Difficult with the leading/trailing dot, to say if it is 100% invalid even if it is not 100% impossible. Nice to know people are reading this page, I refer back to it sometimes myself!
wolf_II
Posts: 1070
Joined: 08 Feb 2015, 20:55

Re: jeeswg's tutorial pages

Today, 10:02

Ahhh, I see. I can create a file named ".abc", but I can not rename "abc" to ".abc" with AHK. Got you. I did not know.

Return to “Tutorials”

Who is online

Users browsing this forum: Indomito and 3 guests