Welcome back JD [was some other stuff]
Welcome back JD [was some other stuff]
- Subject: Welcome back JD [was some other stuff]
- From: Nigel Garvey <email@hidden>
- Date: Thu, 1 Aug 2002 13:50:14 +0100
John Delacour wrote on Wed, 31 Jul 2002 18:41:50 +0100:
>
Now that shell scripting is possible, it makes little sense to
>
continue using the verbose and unwieldy syntax of AppleScript,
>
especially since the record shows very little advance since AS was
>
first introduced -- I see the Finder aete, which has always been a
>
mess, is now even messier than ever and has all sorts of gaps. With
>
the new 'do shell script' event, however, there is a way to use
>
Applescript simply as a caller and for IAC.
Hi, John. Welcome back. It sounds as though you're not intending to stay
for long. ;-)
On Wed, 31 Jul 2002 21:34:28 +0100, you wrote:
>
(* Classic *)
>
set ls to {}
>
repeat with i from 1 to 1000
>
set i to text -4 through -1 of ("000000" & i)
>
set end of ls to "" & i & ".html"
>
end repeat
>
ls
This still works well, but things have progressed a little since you've
been away. It's now realised that maths operations, where applicable, are
more efficient than text ones and that concatenations that invoke silent
coercions take longer than the explicit coercions alone. (In the script
above, of course, 'i' is *created* as a string, so the concatenation to
"" is unnecessary.)
set ls to {}
repeat with i from 1 to 1000
set i to text -4 through -1 of (10000 + i) as string
set end of ls to i & ".html"
end repeat
ls
This is a good illustration of a point mentioned the other day: that 'i'
the loop counter is different from the 'i' created within the loop.
NG
_______________________________________________
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.