Re: Too simple to find an answer for...
Re: Too simple to find an answer for...
- Subject: Re: Too simple to find an answer for...
- From: Andrew Oliver <email@hidden>
- Date: Thu, 29 Jul 2004 13:33:46 -0700
And just what do you expect this script to do?
The 'summarize' command takes a block of text and tries to extract the
relevant content to a summary that highlights the important parts of the
document. It has no effect on a list of integers.
If what you're trying to do is sum (i.e. add) all the integers, you'll
either need to loop through them, or use some OSAX that can do it for you
(without checking, I'm guessing the Satimage OSAX will do this 0- it does
just about everything else ;) )
on getSum (theList)
set theSum to 0
repeat with eachItem in theList
try
set theSum to (eachItem as number)
end try
end repeat
return theSum
end getSum
Andrew
:)
On 7/29/04 12:36 PM, "Bernardo Hoehl" <email@hidden> wrote:
>
I searched for apple's subroutines and my O'Reilly's Applescript book,
>
and can't find an answer to this very simple one:
>
>
set MyNumberList to {5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2}
>
>
set x to the summarize of every item of MyNumberList --- error
>
>
Thanks!
>
>
Bernardo Hoehl
>
>
Rio de Janeiro - Brazil
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.