Hello, A question please. Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AutoX
Posts: 13
Joined: 14 May 2022, 12:14

Hello, A question please.

Post by AutoX » 16 May 2022, 09:54

Hello community, I have a question, the Comma ( , ) must be written obligatorily in Commands? I see sometimes yes and other times not, eg Send, {RButton Up} = Send {RButton Up}.
Is better put Commas?.

Rohwedder
Posts: 7647
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Hello, A question please.  Topic is solved

Post by Rohwedder » 16 May 2022, 10:13

Hallo,
see: https://www.autohotkey.com/docs/Language.htm#commands
The comma separating the command name from its parameters is optional, except in the following cases: …
I personally opt to use it.

AutoX
Posts: 13
Joined: 14 May 2022, 12:14

Re: Hello

Post by AutoX » 16 May 2022, 13:43

Please another question: is supported write Commands continuously (without spaces). I remember some Script without spaces and it worked, I don't remember if had ( ; ) between command or nothing. Maybe like that:

Code: Select all

; NORMAL:
#NoEnv
SetBatchLines,-1
#SingleInstance,force
SetWorkingDir %A_ScriptDir%

Code: Select all

; COMPRESSED
#NoEnv;SetBatchLines,-1;#SingleInstance,force;SetWorkingDir %A_ScriptDir%
In any case is possible compress text of a Script?, thanks.
Last edited by BoBo on 16 May 2022, 14:54, edited 1 time in total.
Reason: Added [code][/code]-tags.

Rohwedder
Posts: 7647
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Hello, A question please.

Post by Rohwedder » 16 May 2022, 14:39

Directives and commands need separate lines, multiple expressions per line must be separated with commas. But one command in expression mode can often contain several expressions. E.g.: F1 key switches clock on/off:

Code: Select all

F1::SetTimer, F1 Up,% (F1:=!F1)?100:"Off"
F1 Up::ToolTip,% F1?A_Hour ":" A_Min ":" A_Sec:""
Do not ask, just try it. Provided, of course, that your script does not control a nuclear reactor.
Last edited by Rohwedder on 16 May 2022, 14:59, edited 1 time in total.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Hello, A question please.

Post by BoBo » 16 May 2022, 14:59

Provided, of course, that your script does not control a nuclear reactor.
:lol: :thumbup: :shh:

gregster
Posts: 9023
Joined: 30 Sep 2013, 06:48

Re: Hello, A question please.

Post by gregster » 16 May 2022, 15:28

AutoX wrote:So should also work like:

; COMPRESSED
#NoEnv,SetBatchLines-1,#SingleInstance force,SetWorkingDir %A_ScriptDir%

Thanks.
Whoops, sorry, I disapproved a post by accident (fat fingers ;) ). I quoted it above.
But to answer it:
Rohwedder wrote:
16 May 2022, 14:39
Directives and commands need separate lines
So, no, #NoEnv;SetBatchLines,-1;#SingleInstance,force;SetWorkingDir %A_ScriptDir% is not possible.

AutoX
Posts: 13
Joined: 14 May 2022, 12:14

Re: Hello, A question please.

Post by AutoX » 16 May 2022, 15:36

Thanks.
:thumbup: :thumbup:

Post Reply

Return to “Ask for Help (v1)”