Change word list of numbers to number list,

Within filemaker pro I have a field with a series of numbers separated by spaces this format feeds into an XMchart plugin which works fine.
The next stage is to find the max and minimum value of this array, string field etc.

This applescript is a simplified version of the one I am trying within Filemaker or as a standalone in applescript:
set wordnumber to 1
set max1 to 0
set string1 to “0.98 .98 34” (usually loaded from filemaker field)
repeat 3 times
set number1 to number wordnumber of string1
display dialog number1
if max1 is less than number1 then
set max1 to number1
end if
set wordnumber to wordnumber + 1
end repeat

The problem I believe I have is with the text delimiters, the second word is extracted as 98 instead of .98
I have messed with:
set olddelims to applescripts text delimiters
replace all" "s to “@@” etc
I can not get the find and replace to work applescript for dummies, well!
set applescripts text delimiters to “@@” and tried this which I found macscripter

search String1 with find attributes {find text:" “} with change attributes {change text:” @@"}
There may be a simpler way to effectively change this to a list of numbers.
Thanks in advance if anyone knows the answer.


try something like this, it splits the numbers using the space delimiter

set wordnumber to 1
set max1 to 0
set string1 to "0.98 .98 34" -- (usually loaded from filemaker field) 

set {TID, text item delimiters} to {text item delimiters, space}
set theNumbers to text items of string1
set text item delimiters to TID

repeat with aNumber in theNumbers
	display dialog aNumber
	set N to aNumber as number
	if max1 is less than N then
		set max1 to N
	end if
	set wordnumber to wordnumber + 1
end repeat

Note: this code works only on a system with a period as decimal separator

Thank you, that worked perfectly, but only on the info I supplied, with a little perseverance I manged those with multiple spaces and those with missing spaces.
Thanks again, Roger

if there are no space characters, how could the script know where to split the string?