Page 1 of 1

command line

Posted: 31 Jan 2023, 13:23
by Luckyjo
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?

Re: command line

Posted: 31 Jan 2023, 15:42
by DuckingQuack
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!

Re: command line

Posted: 03 Feb 2023, 19:27
by boiler
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.

Re: command line

Posted: 03 Feb 2023, 22:28
by Tebayaki

Code: Select all

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

Re: command line

Posted: 04 Feb 2023, 03:09
by neogna2
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 ")