• 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: Handler issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handler issue


  • Subject: Re: Handler issue
  • From: has <email@hidden>
  • Date: Mon, 3 Mar 2003 13:11:47 +0000

Jan Bruners wrote:

This gives me an error. Why?

tell application "Mailsmith 1.5"
...
GrepReplace("kaeufer", kaeufer)
...
end tell


Because all calls/commands/messages [1] - call them what you will - are sent to the object specified by the enclosing tell block, in this case 'application "Mailsmith"'. Mailsmith doesn't know how to respond to a 'GrepReplace' command, hence the [somewhat cryptic] error.

Solution 1: move the 'GrepReplace' call outside the tell application block so that it gets sent directly to the script:

tell application "Mailsmith 1.5"
...
end tell
GrepReplace("kaeufer", kaeufer)


Solution 2: [re]direct the GrepReplace message to the script by using AppleScript's special 'me' variable (which, conveniently, holds the script in question):

tell application "Mailsmith 1.5"
...
tell me to GrepReplace("kaeufer", kaeufer)
...
end tell

or:

tell application "Mailsmith 1.5"
...
GrepReplace("kaeufer", kaeufer) of me
...
end tell

or:

tell application "Mailsmith 1.5"
...
my GrepReplace("kaeufer", kaeufer)
...
end tell


has

[1] Their syntax may look different, but their basic meaning is not.
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Cocoa Loco
  • Next by Date: anyone seen this FileMaker Pro bug?
  • Previous by thread: Re: Printing pdf via applescript
  • Next by thread: anyone seen this FileMaker Pro bug?
  • Index(es):
    • Date
    • Thread