Re: Handler issue
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.