osx - Prevent Email From Being Sent via Applescript -
I have the following AppleScript (below). I'm trying to confirm sending an email. This Apple script has already been successfully In Mail.app, the "Outbox Rules" (using the Mail Acton) is connected, and I have verified that when it is (at the time of sending) it runs.
The ultimate purpose is to pop a dialog to the user, by asking if they really want to "send email" if not, stop sending email.
The current script tries to delete the message, but does it not work any ideas?
List for the rule to perform mail operations with the "mail" message message using the message from the message. Repeat this message with this message to display the Set Message Set dialog in context "Send"? Button "OK", "Cancel"} Default button 2 If the button is not given equal to "result", then delete this message, if the end repeat end mail action is
I think the "cancel" button in the display dialog
is immediately your script which means that < Code> Delete this message line never runs.
You can try to do something like:
set dialog to "send?" Button "OK", "No, delete message"} Default button 2 If the button is returned from the result then "OK" is not equal to ...
Comments
Post a Comment