• 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: Running Stay-open scripts from the command line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running Stay-open scripts from the command line


  • Subject: Re: Running Stay-open scripts from the command line
  • From: email@hidden
  • Date: Sat, 26 May 2001 16:46:35 -0700

On Thursday, May 24, 2001, at 10:19 PM, Michael Ellis <email@hidden>
wrote:

<snippage>
my message("Hello")

on message(textVar)
log "Message = " & textVar
end message

I found that ScriptEditor had no trouble running it. However, when I
execute the following it reports "script doesn't understand message
message":

Any suggestions? I was thinking that it might be a problem with running
the script in the default context, but further investigation seems to
indicate that it isn't that. I am calling this Carbon code from a Cocoa
application -- could it have something to do with the Apple Event Handler
(or lack of one)?

First thing is that anything involving the APIs should probably go to the applescript-implementors list, where there's more bandwidth for programming questions and a larger community of programmers to help.

Without knowing what the error code you're getting is, I can't really tell you what's going on, but the OSAExecute call is known to work in Mac OS X (it's what the Script Editor calls, so it's got to work). But one thing that I notice is that your example comprises only a Log event.

The Log event is defined only in the Script Editor and third-party editors; not in AppleScript, not in applets, not in Standard Additions. So executing it outside of an application that installs 'log' event handlers will cause an error. I don't know if that's the error you're getting, but if it's not, even once the other problem's fixed, you'd get an error trying to execute a Log event.

Try it with a different body content in the message script.

Chris


  • Prev by Date: Re: automating e-mail replies
  • Next by Date: Opening new window in Fetch
  • Previous by thread: Re: Running Stay-open scripts from the command line
  • Next by thread: Scripting For Eudora X
  • Index(es):
    • Date
    • Thread