On Feb 27, 2012, at 20:49, Manuel wrote: It works! I also realized that here is Spain we use the comma "," for the decimal numbers, instead of "." that´s why I had the strange results. Now, how can I take the results to a new TextEdit Document ?
... but I get a -10000 error, in the Apple Events Manager.
______________________________________________________________________
Hey Manuel,
It appears to me that you're trying to dump a list object into TextEdit. It needs text.
set someText to "Now is the time for all good men to come to the aid of their country." tell application "TextEdit" set newDoc to make document set text of newDoc to someText end tell
Going back to your original problem.
I was wondering why the script failed here on my machine, so I was relieved to know the issue was as simple as the '.' ',' substitution. :)
One of the many reasons I keep the Satimage.osax on my machine is for its 'statlist' function:
set l to {"4.954", "2.934", "4.178", "7.217", "5.324", "5.752", "6.171", "7.160", "6.894", "9.710", "9.161", "8.556", "7.299", "6.998", "10.010", "10.949", "10.134", "9.988", "9.675", "5.091", "3.973"}
statlist l
{ maximum:10.949, maximum index:16, minimum:2.934, minimum index:2, sum:152.128, mean:7.24419047619, variance:5.259980535147, stdev:2.293464744692, missing value:0 }
In your original script I noticed a couple of little things:
set AppleScript's text item delimiters to "" --< Unnecessary set AppleScript's text item delimiters to ","
And:
repeat with i from 4 to the count of ListaPuntos by 5
Although Applescript has sped up so much that this point is really minor now, it's better practice to use the 'length' property of a list rather than the 'count' command.
-- Best Regards, Chris
|