• 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: 'include' statement in applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'include' statement in applescript


  • Subject: Re: 'include' statement in applescript
  • From: Graham Anderson <email@hidden>
  • Date: Tue, 25 Jan 2005 15:43:40 -0800



thanks for the info :)

still it would be nice to have a real 'include' statement without loading/compiling scripts
I'll check out the 'load script' command


g
On Jan 25, 2005, at 2:49 PM, Brian Johnson wrote:


On Tue, 25 Jan 2005, Graham Anderson wrote:

I was doing that before..but if you've got a fairly long script...it makes it a bit harder to deal with

so, does applescript have some kind of include capability ?

if not, I'll go back to calling handlers within handlers :(

Here's a suggestion that might help. If you're using Script Editor on an OS-X box, go to the file menu, pick "Open Dictionary". Scroll through the list to "standard additions" and pick it. What you'll see is a list of the commands that come built in to AS. Expand "Scripting Commands" to find "load script". It does what you want to do.


Alternative, write hander1 as

  on handler1(whatever)

    .. lots of AS stuff ..

    return "handler1 done at "&(current date) as text

  end handler1

and save it as a stay-open application named "handler1". Repeat with handlers 2 and 3. Now, write the main application:

  set football to tell application "handler1" to handler1( params )
  set baton to tell application "handler2" to handler2( football )
  set buck to tell application "handler3" to handler3( baton )

  display dialog "Handoffs:" & buck

So, it's easy to do even large projects in AS, as long as you work in a modularized way. Good luck.

 - brian johnson (etc)


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >'include' statement in applescript (From: Graham Anderson <email@hidden>)
 >Re: 'include' statement in applescript (From: Michael Grant <email@hidden>)
 >Re: 'include' statement in applescript (From: Graham Anderson <email@hidden>)
 >Re: 'include' statement in applescript (From: Brian Johnson <email@hidden>)

  • Prev by Date: Re: 'include' statement in applescript
  • Next by Date: (no subject)
  • Previous by thread: Re: 'include' statement in applescript
  • Next by thread: Re: 'include' statement in applescript
  • Index(es):
    • Date
    • Thread