• 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: Why put all handlers at the top of the script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why put all handlers at the top of the script?


  • Subject: Re: Why put all handlers at the top of the script?
  • From: Stan Cleveland <email@hidden>
  • Date: Fri, 20 Mar 2015 11:12:54 -0700

On Mar 20, 2015, at 7:46 AM, S. J. Cunningham <email@hidden> wrote:

> Why put all handlers at the top of the script?

Hi S. J.,

Handlers go to the bottom here. I don't care about a small bump in execution speed. My scripts are organized with a consistent format that's designed for ease of navigation.

Below is a sample of the format I use. It's generated dynamically by script, when a new project is created in our code repository. Optional sections (notes, libraries, set up, and clean up) are deleted and other sections are added, as needed.

Stan C.


(********************************************************
	[Project Title] AppleScript
	Copyright © 2015 Color Technology Inc.
		All rights reserved.
	Written by Stan Cleveland
		Color Technology Inc.
		2455 NW Nicolai Street
		Portland OR 97210
*********************************************************
	Script dependencies:
		Mac OS X 10.8.x or higher
		Hamish Sanderson's AppleModsTools.osax v0.12.0
		[Add as needed]
*********************************************************
	Notes:
		[Add as needed]
*********************************************************
	Version history:
		v1r0  (2015/03/20) -- Initial version.
*********************************************************)

-------------------------------------------------------------------------------------------
---------------------     SCRIPT CONFIGURATION FOLLOWS     --------------------
-------------------------------------------------------------------------------------------
property deploymentVersion : "v1r0"

--------------------------------------------------------------------------------------------
------------------------------     LIBRARIES FOLLOW     ------------------------------
--------------------------------------------------------------------------------------------
property _Loader : AppleMods Loader
property _Basic : missing value
on __load__(moduleLoader)
	tell moduleLoader
		set _Basic to loadModule("Basic")
	end tell
end __load__
property _ : _Loader's initScript(me)

-------------------------------------------------------------------------------------------
--------------------------------     SET UP FOLLOWS     ------------------------------
-------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------
--------------------------     MAIN PROGRAM FOLLOWS     --------------------------
-------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------
------------------------------     CLEAN UP FOLLOWS     -----------------------------
-------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------
------------------------------     HANDLERS FOLLOW     -----------------------------
-------------------------------------------------------------------------------------------


 _______________________________________________
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: Why put all handlers at the top of the script?
      • From: 2551 <email@hidden>
References: 
 >Why put all handlers at the top of the script? (From: "S. J. Cunningham" <email@hidden>)

  • Prev by Date: Re: Why put all handlers at the top of the script?
  • Next by Date: Re: Why put all handlers at the top of the script?
  • Previous by thread: Re: Why put all handlers at the top of the script?
  • Next by thread: Re: Why put all handlers at the top of the script?
  • Index(es):
    • Date
    • Thread