Re: max script size
Re: max script size
- Subject: Re: max script size
- From: has <email@hidden>
- Date: Thu, 20 Mar 2003 00:55:15 +0000
Martin Crisp wrote:
If the subscripts needed to refer to properties of the main script
then they needed to refer to 'theProperty of current application'.
Rather an odd way of doing it. The usual hack involves mucking with
globals (which I've found tends to lead to rats' nest code). Most
solid approach I've found is to pass the main script into the
subscript, either as an extra parameter to the handlers that use it,
or in a separate operation, stuffing it into a property in the
subscript where it can be referenced by the subscript's handlers. If
it starts getting complicated, it's a good hint that the dividing
lines have been drawn in the wrong places and should be moved.
I couldn't ever get attempts at sub-sub-scripts to work.
Not an AppleScript problem. Must've been something in your design.
I noticed a substantial speed improvement when I amalgamated my
scripts into a single script, but I can't put a figure on how much
that had to do with the amalgamation and how much to do with the
OS9->X changes I made. That said, the speed differece was a factor
of 3 to 4. On that basis I'd suggest you not split the script up
unless you absolutely have to, but others may have different
experiences...
Your speedup would be almost entirely due to your other code changes
and generally improved performance in OS X. The time it takes
AppleScript to resolve the reference to the script object is
insignificant compared to the time it takes it to do most everything
else. So there's no justification for saying "don't split up the
script". (Get yourself a timing osax such as GetMilliSec and run some
tests if you're not convinced.)
has
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
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.