Script help with Wire Tap?

The following script runs fine whether it is from SE or as an application

--radio stream to open
set URL2open to "http://www.edge.ca/player/player.cfm"

--get how long to record
	set a to display dialog "How many hours to record?" default answer ""
	set RECtime to text returned of a
	if RECtime is equal to "0" then
--if "0" entered record for "1" hour
		set RECtime to "1"
	else
--convert inputted time to seconds for delay
		set RECtime to (RECtime * 60 * 60)
	end if

--get how long till recording starts	
	set b to display dialog "How long till recording starts in hours?" default answer ""
	set RECstart to text returned of b
	if RECstart is equal to "0" then
--if "0" entered set record delay to "1" hour
		set RECstart to "1"
	else
--convert inputted time to seconds + 10 seconds for delay
		set RECstart to ((RECstart * 60 * 60) + 10)
	end if

--open url in IE (Stream wont stream to Safari)	
	tell application "Internet Explorer"
		Activate
		GetURL URL2open
	end tell

--start delay timer	
	delay RECstart

--activate wiretap for recording	
	tell application "WireTap"
		activate
		start recording
	end tell

--record program for desired time	
	delay RECtime

--stop recording	
	tell application "WireTap"
		activate
		stop recording
		try
			quit
		end try
	end tell

--rename recording	
	set currentFolder to ("STURM/Users/iconan/Desktop" as POSIX file) as text
	set nameChange to "show001.aiff"
	set theDate to (current date) as text
	set twoDate to (words 1 thru 3) of theDate
	set newName to "edge" & twoDate & ".aiff"
	
	tell application "Finder"
		if file newName of folder currentFolder exists then
			set name of file nameChange of folder currentFolder to ("2" & newName)
		else
			set name of file nameChange of folder currentFolder to newName
		end if
	end tell
	
--quit IE
	tell application "Internet Explorer" to quit

but when assigned to a button and with on clicked/end clicked in AS Studio it fails on this line

set RECtime to text returned of a

with an error message
AppleScript Error
Can’t make “.005” into a number. (-1700)

Any reason why this is???

Thank You
C. Mullins

Perhaps AppleScript studio is just fussy about those implicit coercions, so try using explicit coercions:

	set RECtime to text returned of a
	set RECtime to RECtime as number
...

If that fails, perhaps AS Studio is just fussy about the format of the number-as-string:

set s to ".005"
set s to "0" & s --> "0.005"
set n to s as number