Detect Key Down & Test Type

Idea: Highlight a number, call the script using a shortcut key, display the highlighted number + 1.
Problems:

  1. How do I detect if it is actually a number? An analogous function would be IsNum().
  2. If the user holds the shortcut key too long, the keystroke “c” is not detected. How do I determine if there is no keys pressed or something similar?

--Need to detect if all keys are up here

tell application "System Events"
	keystroke "c" using {command down}
end tell

--Allow time for the clipboard contents to change.
delay 0.2

--Need to detect if the clipboard has a number in it.

set dRequest to ((the clipboard) as number) + 1 
display dialog dRequest

Moving to OS X.

If a value can’t be coerced, it throws an error.

"a" as number
--> Can't make "a" into type number.

-- Delay To Allow The User With Sausage Fingers To Let Go Of Hotkey
delay 0.5
-- Clear Clipboard
set the clipboard to null
-- Copy Selection To Clipboard
tell application "System Events"
	keystroke "c" using {command down}
end tell
-- Allow Time For The Clipboard To Change
delay 0.2
-- Display And Test Result
try
	set dRequest to ((the clipboard) as number) + 1
on error
	display dialog "The current selection is not a number." buttons {"OK"}
return null
end try
display dialog dRequest buttons {"OK"}