Hello ,
I have beeen fiddling with Applescript but as I want to “translate” my excel visualbasic procedures for excel 2008, I have decided to start from scratch and learn the language properly.
I am reading the book Applescript:the definitive guide. I have found errors in the sample scripts and have been able to correct them until I reached page 153 where I found this script:
on filter(L, crit)
script filterer
property criterion : crit
on filter(L)
if L = {} then return L
if criterion(item 1 of L) then
return {item 1 of L} & filter(rest of L)
else
return filter(rest of L)
end if
end filter
end script
return filterer's filter(L)
end filter
on isNumber(x)
return ({class of x} is in {real, integer, number})
end isNumber
filter({"hey", 1, "ho", 2, 3}, isNumber)
Script debugger gives me an error"Expected expression but found command name." for the line
return filterer’s filter(L)
Can anyone corrects that script?
Thank you