• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Too simple to find an answer for...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Too simple to find an answer for...
      • From: Martin Orpen <email@hidden>
    • Re: Too simple to find an answer for...
      • From: Paul Berkowitz <email@hidden>
References: 
 >Too simple to find an answer for... (From: Bernardo Hoehl <email@hidden>)

  • Prev by Date: Re: Getting the default language with AppleScript
  • Next by Date: Fwd: Too simple to find an answer for...
  • Previous by thread: Too simple to find an answer for...
  • Next by thread: Re: Too simple to find an answer for...
  • Index(es):
    • Date
    • Thread