• 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: AppleScript-Users Digest, Vol 6, Issue 87
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript-Users Digest, Vol 6, Issue 87


  • Subject: Re: AppleScript-Users Digest, Vol 6, Issue 87
  • From: email@hidden
  • Date: Sun, 22 Feb 2009 02:51:28 +0000
  • Importance: Normal




----- Original Message -----
From: applescript-users-request
Sent: 21/02/2009 08:01 PM
To: email@hidden
Subject: AppleScript-Users Digest, Vol 6, Issue 87

Send AppleScript-Users mailing list submissions to
	email@hidden

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.apple.com/mailman/listinfo/applescript-users
or, via email, send a message with subject or body 'help' to
	email@hidden

You can reach the person managing the list at
	email@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of AppleScript-Users digest..."


Today's Topics:

   1. Re: including source code (Simon Topliss)
   2. Re: including source code (email@hidden)
   3. Re: including source code  <Jim Brandt> (email@hidden)


----------------------------------------------------------------------

Message: 1
Date: Sat, 21 Feb 2009 17:15:18 +0000
From: Simon Topliss <email@hidden>
Subject: Re: including source code
To: Applescript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

Hi Jim,

What I would do, and have done personally, is to break your libraries
into separate, related libraries.

For example, I have separate libraries named lib_strings, lib_numbers,
lib_write_to_file, etc. I've got 21 separate, self-contained 'master
libraries'.

Each of these separate libraries can load other dependent libraries
when called. So, if the lib_numbers requires the lib_strings script,
it loads this when it is loaded.

If you want an idea of an approach to achieve this, look at http://applemods.sourceforge.net/modBrowser.html
. Hamish (has) has a great selection of ready-made libraries that I
used as a starting point. His implementation is somewhat confusing for
most applescript users, but it's well worth trying to understand why
and how it's done.

Simon

On 20 Feb 2009, at 20:22, Jim Brandt wrote:

> OK, so I've been writing scripts off and on (more off than on) for
> maybe ten years now. While I first explored AS under OS9, I jumped
> to OneClick because I found it more consistant back then. When OSX
> became the OS of choice, I was forced to redo everything in AS.
> The road has been challanging, but enlightening.
>
> My question has to do with reusable code. Currently I have a half
> dozen
> handlers that I keep in a single file and load using a "load script"
> command. However, this means I load a fair amount of source code
> that I may not need for the particular script I'm writing, in order to
> get a single function that I do need. Is there a better way to do
> this?
>
> Would I be better off loading each handler as a seperate piece of
> code?
>
> Is there another option?
>
> TIA, Jim
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (applescript-
> email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden



------------------------------

Message: 2
Date: Sat, 21 Feb 2009 09:26:46 -0800
From: "email@hidden" <email@hidden>
Subject: Re: including source code
To: Applescript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

>
>
>> OK, so I've been writing scripts off and on (more off than on) for
>> maybe ten years now. While I first explored AS under OS9, I jumped
>> to OneClick because I found it more consistant back then. When OSX
>> became the OS of choice, I was forced to redo everything in AS.
>> The road has been challanging, but enlightening.
>>
>> My question has to do with reusable code. Currently I have a half
>> dozen
>> handlers that I keep in a single file and load using a "load script"
>> command. However, this means I load a fair amount of source code
>> that I may not need for the particular script I'm writing, in order
>> to
>> get a single function that I do need. Is there a better way to do
>> this?
>>
>> Would I be better off loading each handler as a seperate piece of
>> code?
>>
>> Is there another option?
>>


I would check out ScriptDebugger. It's not free, but it does have the
ability to automatically include handlers and libraries in your
scripts in a way that requires a few steps to set up and then works
without any extra effort.

http://www.latenightsw.com/sd4/

ES



------------------------------

Message: 3
Date: Sat, 21 Feb 2009 10:56:08 -0700
From: email@hidden
Subject: Re: including source code  <Jim Brandt>
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes


On Feb 21, 2009, at 8:40 AM, Jim Brandt wrote:
>
> My question has to do with reusable code. Currently I have a half
> dozen
> handlers that I keep in a single file and load using a "load script"
> command. However, this means I load a fair amount of source code
> that I may not need for the particular script I'm writing, in order to
> get a single function that I do need. Is there a better way to do
> this?
>
> Would I be better off loading each handler as a seperate piece of
> code?
>
> Is there another option?
>


Depending on how much code you are talking about, another way to go is
similar to what Apple uses for some of their sample code.  I use
insertion
wrappers around various handlers, and place them into the Scripts Menu.
Clicking on the menu item inserts the handler code at the desired place.




------------------------------

_______________________________________________
AppleScript-Users mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/applescript-users

End of AppleScript-Users Digest, Vol 6, Issue 87
************************************************


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
 _______________________________________________
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

  • Prev by Date: adding a new rule to Mail
  • Next by Date: Re: AppleScript-Users Digest, Vol 6, Issue 87
  • Previous by thread: Re: adding a new rule to Mail
  • Next by thread: Re: AppleScript-Users Digest, Vol 6, Issue 87
  • Index(es):
    • Date
    • Thread