• 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: Stan Cleveland <email@hidden>
  • Date: Thu, 11 Aug 2011 14:33:16 -0700

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.

 _______________________________________________
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

  • Follow-Ups:
    • Re: Script size question
      • From: "Zavatone, Alex" <email@hidden>
References: 
 >Script size question (From: "Zavatone, Alex" <email@hidden>)

  • Prev by Date: Re: Height of Dock ?
  • 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