• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Script size question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script size question


  • Subject: Re: Script size question
  • From: "Zavatone, Alex" <email@hidden>
  • Date: Thu, 11 Aug 2011 15:02:17 -0700
  • Acceptlanguage: en-US
  • Thread-topic: Script size question

Wow.  I made some changes and now I get a stack overflow simply trying to run the script in the Script Debugger and in the AS Editor.

On Aug 11, 2011, at 4:33 PM, Stan Cleveland wrote:

On Aug 11, 2011, at 1:48 PM, Zavatone, Alex wrote:

I've currently got one script that's 2097 lines, including white space.

Do any of you run/crate scripts this size?

If so, are you having any size related issues with the script in either the AS editor or the Script Debugger?

Hi Alex,

I have a number of scripts that exceed 2000 lines and a couple well over 5000 lines. There's only one gotcha that I know of (and I've hit it a few times in the past), which is that there's a limitation on the number of "style runs" allowed within one script.

What's a style run you ask? It's a contiguous section of code that shares the exact same font/style/color for its syntax coloring. When the font, style, or color changes, that's the start of a new style run. A single line of code can contain many style runs. The following one contains fifteen (including the parentheses and comma):

set theFolder to choose folder with prompt thePrompt default location (path to desktop) without invisibles, multiple selections allowed and showing package contents

To quote an email from Mark Alldritt, "Enabling debugging in Script Debugger...makes this worse because Script Debugger introduces hidden code into your script in order to facilitate step-wise execution. This effectively shortens the maximum size for scripts." The hidden code effectively introduces more style runs.

I've done two things to counter this problem. First, I've simplified my syntax coloring preferences by eliminating bold and italics and have switched to one color for related items. (All the scripting addition stuff, for example, is purple.) 

Second, I've made use of AppleMods Loader (http://applemods.sourceforge.net/) for loading my own, custom-written handler libraries. This removes many handlers from the main script. Of course, there are any number of ways to load libraries, including Script Debugger's "Library" functionality and the load script command from Standard Additions. I prefer the simplicity and robustness of AppleMods.

HTH,
Stan C.

<ATT00001..txt>

This email message and any attachments are for the sole use of the intended recipient(s) and may contain information that is proprietary to U.S. Foodservice, Inc and/or its subsidiaries or otherwise confidential or legally privileged. If you have received this message in error, please notify the sender by reply, and delete all copies of this message and any attachments. If you are the intended recipient you may use the information contained in this message and any files attached to this message only as authorized by U.S. Foodservice. Files attached to this message may only be transmitted using secure systems and appropriate means of encryption, and must be secured using the same level password and security protection with which the file was provided to you. Any unauthorized use, dissemination or disclosure of this message or it's attachments is strictly prohibited.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Script size question (From: "Zavatone, Alex" <email@hidden>)
 >Re: Script size question (From: Stan Cleveland <email@hidden>)

  • Prev by Date: Re: Script size question
  • Next by Date: Re: Script size question
  • Previous by thread: Re: Script size question
  • Next by thread: Re: Script size question
  • Index(es):
    • Date
    • Thread