Auto add numeric values to clipboard

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jellypigeons123
Posts: 1
Joined: 21 Feb 2018, 05:20

Auto add numeric values to clipboard

21 Feb 2018, 05:24

Is it possible for something like this to happen? Example:

I copy a number, 324.11

Upon pasting the number, it is 325.11, because 1 was automatically added.

Is there a way for this to work, and a way to select which number you want it to add?

Thank you
User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: Auto add numeric values to clipboard

21 Feb 2018, 07:18

This code starts with a default number of 1 to be added. Press F1 to enter a new number to be added. Whenever the clipboard changes and it contains a number, it will add the number to be added to it, ready to be pasted.

Code: Select all

global AddNum := 1
OnClipboardChange("AddToClip")
return

AddToClip()
{
	if Clipboard is number
	{
;		MsgBox, % Clipboard "`n" AddNum
		OnClipboardChange("AddToClip", 0)
		Clipboard := Format("{:g}", Clipboard + AddNum)
		OnClipboardChange("AddToClip")
	}
}

F1::InputBox, AddNum, Clipboard Add, Enter number to be added to the clipboard:,, 320, 144,,,,, %AddNum%

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CrowexBR, Theda and 271 guests