Re: mac script size revisited
Re: mac script size revisited
- Subject: Re: mac script size revisited
- From: Michael Glasser <email@hidden>
- Date: Wed, 9 Apr 2003 20:38:55 -0700
Your suggestion works for me... mostly (thanks, btw)
One problem... you say for sanities sake that I should not rely on
globals... well, apparently I am not sane. :)
I have ONE global variable that I can not find a way to not need to
pass... my functions not only rely on it to come up with a result, they
also sometimes effect this variable.
Any ideas on how I can deal with globals? Just one variable... if that
helps...
Thanks again
On Wednesday, April 9, 2003, at 04:20 PM, Andrew Oliver wrote:
First, move whatever functions you like into a separate script. For
sanity's
sake, make sure the functions are self-contained and don't rely on
globals,
etc. that might not be available.
Then in your main script:
set scriptLib to load script "path:to:script library"
Now, anywhere in your script you call a function/handler by:
set myVar to scriptLib's functionName()
Obviously, substituting the appropriate function name and providing any
relevant parameters for the function.
On 4/9/03 3:48 PM, "Michael Glasser" <email@hidden> wrote:
I have a fairly big script... over 5000 lines and about 240KB. When I
try to check the syntax it tries for a few seconds and then does
nothing. When I try in Smile, it gives me an error code -108, which
on
Apple's site is listed as "Out of memory".
I have 1.5 GB of mem, am running OS X 10.2.4... I find it hard to
believe that memory is really the problem.
I can remove the last 50 or so lines of the code and the syntax checks
out OK... the same is true for the 50 lines removed. It fails as soon
as I add back any of the several functions that are in those 50
lines... so it does not seem to be based on faulty code.
Ever since I added functions I have not been able to run the code as a
program... runs from the beta script editor just fine, but gave errors
when run as a program.
Any ideas? What is the best way to call functions from another script
if I have to split my code into multiple files?
Any help is appreciated...
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.