Aplescripting Mail's Rule Actions
Aplescripting Mail's Rule Actions
- Subject: Aplescripting Mail's Rule Actions
- From: "S. J. Cunningham via AppleScript-Users" <email@hidden>
- Date: Wed, 23 Sep 2020 05:08:28 -0400
i have been experimenting with writing my own spam handling routines using
Mail's rule actions. I have learned some interesting things which I can't find
documented anywhere and which make developing rule action scripts even more
vexatious than developing other scripts :) The biggest vexation is that the
"on perform mail actions" handler gobbles up any error message. Thus, for
example, if there is an undefined variable in a display dialog call, there is
no indication of it, you don't get the dialog. and the script merrily wanders
off in some random direction. The same fate awaits try-on error blocks: the
"on error" block is never executed. Another limitation is that you can't open
another application or script object from your script. Trying to open a
FileMaker database, for example, gives you the cryptic message "Error -1713.
FileMaker Pro got an error: No user interaction allowed". Curiously, this
error is not captured by a surrounding try-on error block. That is, the
message is not passed to the "on error "handler. You can, however, write to an
already open database.
The only way I have been able to debug and figure out what is going on with my
scripts is with copious display dialogs. When an expected dialog doesn't
appear, I know that some invisible error has occurred before that point.
Either that or there is something wrong with the display dialog call itself.
I suppose these limitations are to prevent delays in processing the message
queue, although display dialog itself works when there are no errors in its
call and it throws up a user dialog - which interrupts the queue processing.
I would be curious to know if these limitations and/or others are documented
anywhere that I have been unable to find. In any event, I am posting my
experience here so that future rule action scripters will be forewarned.
Steve Cunningham
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden