command line

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Luckyjo
Posts: 1
Joined: 29 Jan 2023, 07:10

command line

Post by Luckyjo » 31 Jan 2023, 13:23

Hello everyone,
I want to place this code;

Code: Select all

  +F5::{
   SendEvent "_fillet{Enter}"
   Sleep 1000
   SendEvent "R"
   sleep 1000
   SendEvent "10.00 "
   }
On a single line, is this possible?
Last edited by joedf on 31 Jan 2023, 17:40, edited 1 time in total.
Reason: [code] tags

User avatar
DuckingQuack
Posts: 219
Joined: 20 Jan 2023, 18:20

Re: command line

Post by DuckingQuack » 31 Jan 2023, 15:42

Simply based on the requirement of the hotkey declaration open bracket and close bracket having to be on two different lines from everything else, I’d say the absolute minimum is three without using a form of shorthand that I know nothing about. But if you only meant the hotkey output, probably not.

Here’s an older thread on the subject in V1.
viewtopic.php?t=67261


Tebayaki and Neogna2 have your answer!
Last edited by DuckingQuack on 04 Feb 2023, 07:34, edited 1 time in total.
Best of Luck,
The Duck

User avatar
boiler
Posts: 16903
Joined: 21 Dec 2014, 02:44

Re: command line

Post by boiler » 03 Feb 2023, 19:27

From that thread, only a slight modification is needed to swagfag’s function to make it work for v2 and to use SendEvent:

Code: Select all

+F5::sendChunksWithDelay(1000, "_fillet{Enter}", "R", "10.00 ")

sendChunksWithDelay(delay, Chunks*) {
	for each, chunk in Chunks {
		SendEvent chunk
		Sleep delay
	}
}

Then of course your calls to that function can all be single lines while the function is tucked away at the bottom of your script or in a separate file with #Include.

User avatar
Tebayaki
Posts: 7
Joined: 04 Aug 2021, 17:59

Re: command line

Post by Tebayaki » 03 Feb 2023, 22:28

Code: Select all

f1::SendEvent("_fillet{Enter}"), Sleep(1000), SendEvent("R"), Sleep(1000), SendEvent("10.00 ")
simply join expression with comma

neogna2
Posts: 589
Joined: 15 Sep 2016, 15:44

Re: command line

Post by neogna2 » 04 Feb 2023, 03:09

Tebayaki wrote:
03 Feb 2023, 22:28
simply join expression with comma
Or without commas

Code: Select all

f1::SendEvent("_fillet{Enter}") Sleep(1000) SendEvent("R") Sleep(1000) SendEvent("10.00 ")

Post Reply

Return to “Ask for Help (v2)”