Type a number starting from 0000 to 9999

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Leafdroid
Posts: 3
Joined: 21 Jul 2017, 09:52

Type a number starting from 0000 to 9999

21 Jul 2017, 10:38

So basically I'm trying to make a script that when pressing NumpadSub types in the number 0000 and presses enter and next press it will be 0001 and so on. Any idea how to do this?
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Type a number starting from 0000 to 9999

21 Jul 2017, 11:07

@ Leafdroid
It looks that Send % Format("{:04i}", num) won't allow a trailing{Enter} at the same line (as per my testing).
Therefore you've to add an additional Send, {Enter} to finally make it.
:silent:
Last edited by BoBo on 21 Jul 2017, 11:18, edited 1 time in total.
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: Type a number starting from 0000 to 9999

21 Jul 2017, 11:11

BoBo wrote:@ Leafdroid
It looks that Send % Format("{:04i}", num) won't allow a trailing{Enter} at the same line (as per my testing).
Therefore you've to add an additional Send, {Enter} to finally make it.
eh? did you maybe forget quotes?

Code: Select all

num := 0
return

NumpadSub::
	Send % Format("{:04i}", num) "{Enter}"
	num++
	return
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Type a number starting from 0000 to 9999

21 Jul 2017, 11:17

@ evilC
Cool! Haven't expected that. Thx for proving me wrong :mrgreen: Wieder was gelernt :thumbup:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], mikeyww and 139 guests