Re: Why put all handlers at the top of the script?
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