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: Martin Orpen <email@hidden>
- Date: Thu, 29 Jul 2004 23:52:18 +0100
on 29/7/04 9:33 pm, Andrew Oliver at email@hidden wrote:
>
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 ;) )
That's not necessarily true:
set MyNumberList to {5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2}
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to " + "
set myResult to do shell script "echo " & (MyNumberList as string) & " |
bc"
set AppleScript's text item delimiters to oldDelims
myResult
-->"58"
It's just a bit of fun :-)
--
Martin Orpen
Idea Digital Imaging Ltd -- The Image Specialists
http://www.idea-digital.com
_______________________________________________
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.