Making a value from a number in my clipboard.

Is there a way to turn a number (which I’ve snatched up into the clipboard from a webpage) into a value? I’m trying to write an IF statement that does one thing if this number is greater then 20000, and another if not.

I’m probably way off here, but I hope I haven’t slaughtered this too much… Mayeb you guys’ll get a laugh out of it. :stuck_out_tongue:

	tell application "System Events"
		set clip to «class ktxt» of ((the clipboard as text) as record)
		
		set txtleng to the length of clip
		repeat with i from txtleng to 1 by -1
			if (character (i) of clip) is not equal to "," then exit repeat
		end repeat
		if i is equal to 1 then
			set clip to ""
		else
			copy (text (1) thru (i) of clip) to clip
		end if
		
		set z to value of clip
		if z is less than "20000" then
			tell application "System Events"
				keystroke "w" using command down
				delay 0.2
			end tell
		else if z is greater than "20000" then
			tell application "System Events"
				keystroke (tab) using control down
			end tell
		end if
		set z to 0
	end tell

Perhaps something like this (try different settings to the clipboard):

set the clipboard to "$25,234"
----
set s to characters of (the clipboard)
set n to ""
repeat with aChar in s
	try
		set n to n & (aChar as integer)
	end try
end repeat
if (n as integer) < 20000 then
	beep
else
	beep 2
end if

That worked perfectly!!! :smiley:

Thanks so much!