• 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: tell application to my_function()?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tell application to my_function()?


  • Subject: Re: tell application to my_function()?
  • From: "Paul F. Henegan" <email@hidden>
  • Date: Thu, 28 Apr 2005 19:51:31 -0400

on 28.04.2005 14:19, Matthew Bogosian at email@hidden wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Unfortunately, this happens even if I use a subroutine with no
> arguments:
>
> AppleScript Studio application "my_app":
>
> on test()
> log "foo"
> end test
>
> on launched the_app
> test()
> end launched
>
> Script:
>
> try
> tell application "my_app" to test()
> on error err
> log err
> end try
>
> tell application "my_app" to quit
>
> When I start my_app, "foo" prints on the Run Log. When I run the
> script, the error message "Can't continue test." is printed to the log,
> and then my_app quits (so the second tell is working).
>
> What does "Can't continue XXX." mean? It's a little vague compared to
> what I'm used to in every other programming/scripting language I've
> ever used. Is there an equivalent to a stack trace or errno in
> AppleScript? Any place I can get more useful information?
>
> Any ideas? Any help is very much appreciated.
>

Hi Matthew,

Sorry I didn't grasp what you were trying to do at first.

In order for a script to know about an application's objects, they need to
be explicitly 'exposed' and given a name in what is called a dictionary.
This is not achieved automatically by saving a script as an application,
although that would be an interesting feature. Here is a link to more
information on making an application scriptable:
<http://tinyurl.com/9v422>

What AppleScript _can_ do is load another script as a script object, which
then makes all objects of the loaded script available to the 'main' script.
Here is a link to the online documentation for Script Objects:
<http://tinyurl.com/2ejva>

Hopefully, someone who is more expert in these areas can jump in and explain
things better.

HTH,

paul
--
Paul F. Henegan
<email@hidden>

 _______________________________________________
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: 
 >Re: tell application to my_function()? (From: Matthew Bogosian <email@hidden>)

  • Prev by Date: Re: Another Keynote-like dictionary
  • Next by Date: Re: Tidying a string
  • Previous by thread: Re: tell application to my_function()?
  • Next by thread: mail via terminal goes to internal address but not to external address
  • Index(es):
    • Date
    • Thread