• 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: Calling handlers in other scripts inside AS application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling handlers in other scripts inside AS application


  • Subject: Re: Calling handlers in other scripts inside AS application
  • From: Paul Berkowitz <email@hidden>
  • Date: Tue, 22 Mar 2005 08:19:00 -0800

Title: Re: Calling handlers in other scripts inside AS application
On 3/22/05 8:07 AM, "Thomas Berry" <email@hidden> wrote:

I've searched the list and found some answers that are close to answering my question but I'm still having difficulty.

I have a handler that is inside a script inside an Applescript application I am writing.  I want to call that handler from another script that is in the same application and needs access to the handler but can't figure out how to do it.

Example:

Inside "Script_A.applescript" is a handler, say, "DisplayDialog()"

As I'm running "Script_B.applescript", I'd like to call DisplayDialog() but I can't figure out how to target it.

I've tried several methods, including making the handler a script object and trying things like:

set
thescript to my Script_B.applescript
    
do script {thescript}

but no luck.

Thanks in advance.

Is this a Studio application? Why would your scripts have .applescript extensions? Those are text files. Even in a Studio application ,applescript files become .scpt files in the built application and are found by 'path to'. Or is this a bundled applet, or what?

Assuming you know how to find Script_B in the bundle, you set a variable (lets say scriptB) to load the (compiled) script and would

    tell scriptB to DisplayDialog()

But if you really have only uncompiled .applescript text files, all you can do is 'run script' the file. You can't call particular handlers.

Can you explain why you are dealing with uncompiled .applescript files here? I'm sure there must be a way to use compiled .scpt files or script applications. In either of those cases you can load the script and call the handler you want.

--
Paul Berkowitz
 _______________________________________________
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: 
 >Calling handlers in other scripts inside AS application (From: Thomas Berry <email@hidden>)

  • Prev by Date: Re: XMAIL Disaster
  • Next by Date: Re: Finder scripting and FileVault
  • Previous by thread: Calling handlers in other scripts inside AS application
  • Next by thread: Re: Calling handlers in other scripts inside AS application
  • Index(es):
    • Date
    • Thread