Re: Please explain this!? More....
Re: Please explain this!? More....
- Subject: Re: Please explain this!? More....
- From: Harald E Brandt <email@hidden>
- Date: Sun, 25 Nov 2001 23:43:05 +0100
+--> Paul Berkowitz wrote 01-11-23:
>
Don't you agree that
>
that's wonderful, once you know about it? Repeat loops can be painfully
>
slow: here AppleScript allows the application to do all the work much faster
>
than iterating a repeat loop in AppleScript ever could.
+-
Absolutely!! Sure! Agreed!
I always try to avoid loops as if they were anthrax!
Anything is faster than a loop in AppleScript (and many other languages).
However, I am not at all impressed by the means I have in AppleScript to avoid loops. On the the other hand, it may be a bit unfair of me to compare with the heavily functional (and preferably array-oriented) languages I have been used to, where for-loops basically are NEVER needed! AppleScript has other merits, but when it comes to list/array/number/string manipulation, it is really weak, slow, and very tedious to debug. But I can't change the language, so I will try to pick up and use as much as possible of the available constructs. (Although, if it would have been possible and I had the choice, I would have used a beast like J for array/list/string/number crunching). I use RegEx Commands quite much since it is so linear and loopfree.
+--
>
By aware that 'whose' clauses are unfortunately _not_ yet
>
implemented for AppleScripts lists or records (a long-standing feature
>
request).
+-
Yes, one of the problems are that I have (several times) read in the ASLG that it only works for application commands, but then, once again, I forget that, and wind up sitting there struggling for an hour with a conscruct, only to "remember" once again, that the particular thing I am about to do involves non-application commands. Hmm..... that lowers my "trust" in the constructs...
+--
>
It is in fact 100%
>
reliable.
+-
Well, hmmm. I just had problems with scripts I tested on an old 8100 running AppleScript 1.3.7, whereas my G4 was behaving well. I got the following, where doing 'alias <something that involved variable>' gave me a file!! Yes I file! In this case, it was necessary to make it an alias. Putting alias afterwards (as alias) instead was the only way to force it into an alias!. Not very reliable for scripts that must work on different machines....
(Below, "BLfolder" is a string)
tell application "Finder" of machine "8100" to <new line>
alias (BLfolder & "Installationslog")
-- file "Installationslog" of folder "Bvrsladdaren 1.5" of startup disk of application "Finder" of machine "8100"
tell application "Finder" of machine "8100" to <new line>
alias (BLfolder & "Installationslog") as alias
-- alias "Backup 406 MB:Bvrsladdaren 1.5:Installationslog"
With the Very Best Regards,
and Thank You for the continued education you often offer!
______heb________________________________________________________________
Harald E Brandt email@hidden PGP/MIME aware
http://heb.bragit.com