• 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: Thomas Berry <email@hidden>
  • Date: Thu, 24 Mar 2005 13:26:03 -0500


On Mar 22, 2005, at 3:00 PM, Paul Berkowitz wrote:

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


Thanks for your response. As you probably guessed, I'm very new to programming my Mac but I'm trying the best that I can. I appreciate your help.

This is a Studio application to build a front end to allow use of the Mac in a car for music, DVD, photos, etc. I am using XCODE to build the Applescript application. As far as I know, this "is" Applescript studio.

Your hints have helped me. I needed to be dealing with the compiled scripts. I was confused because XCODE gives the name of the scripts as "ScripA.applescript". So I was targeting the uncompiled file. Since then I've got the problem of calling a handler "DidIt()" from a script "RawList" down to the following in a test application:

set myPath to path for script "RawList" extension "scpt"
display dialog myPath
tell myPath to DidIt()

The dialog properly displays the posix path for the script. However, when I try to run the handler DidIt() in the last line of the script, I get an error "Can't get DidIt of " followed by the posix path of the script.

Sorry for sounding like I'm completely lost here, but I'll learn. I promise. I'm wearing out my Neuberg book on Applescript.
 _______________________________________________
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

  • Follow-Ups:
    • Re: Calling handlers in other scripts inside AS application
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Issue with AS variable in OS 10.2
  • Next by Date: Re: This Used To Work
  • Previous by thread: Re: Calling handlers in other scripts inside AS application
  • Next by thread: Re: Calling handlers in other scripts inside AS application
  • Index(es):
    • Date
    • Thread