Can an AppleScript prevent [Send] from sending a message?

I want to keep myself from sending messages unless they meet certain criteria. Ideally, I would like an AppleScript to fire whenever I click the [Send] button. The script would examine the message, and then either allow it to be sent if it passes the criteria, or cancel the send request and display an error message, if it doesn't. In the latter case, my intent would be to fix the problem, and re-click the [Send] button.
Any ideas how to do this?
TIA,
Mark
MacBook Pro   Mac OS X (10.4.9)  

What you would need to do would be:
1. Control-click on the 'Send' icon and choose 'remove' (you can still send a message with Control-shift-D of from the 'Message' menu and you can restore the ikon by control-clicking in the toolbar of a new message).
2. Write an Applescript to evaluate and send. Save it as a script, not an application, in (username)>Library>Scripts>Mail scripts. It will be accessible from the Mail scripts menu (the icon) and you should be able to assign a keystroke to it in System Preferences>Keyboard and Mouse>Keyboard shortcuts.
The Applescript would take the form
if (message complies with conditions) then
(send the message)
else
(beep, or 'say "Cannot send"', or some indicator).
I can't tell you how to frame the script: there is a 'send' command but I couldn't persuade it to send a message. You could look for an Applescript forum.

Similar Messages

  • How to use canon pixma MX377. I can't receive and send fax messages

    Can please anyone send me complete instruction manual in english for my pixma canon MX377 machine because I can't receive and send fax messages. I'm connected to a PBX extension line or a xDSL splitter. Every time i called a person on the machine, I can hear him but he can't hear me. Thank you very much.

    Hi rgc,
    The PIXMA MX377 user's manual is available in an online format and can be downloaded from the Canon Asia website.  The following link will take you to the Manuals page for the PIXMA MX377:
    http://support-asia.canon-asia.com/P/search?model=PIXMA+MX377&filter=0&menu=manual
    Once on the page, please scroll through the list and select the manual that corresponds to your operating system (Windows or Mac), then click the DOWNLOAD NOW button on the following page that appears to download and view the manual.
    This didn't answer your question or issue? Find more help at Contact Us.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Hi! I brought an iPhone 4 off my friend at work. The day I brought it, it was working fine but now I can't seem to send any messages or make phone calls. The network is showing up fine but each time I try to make a call it says "call failed" help any1?

    Hi! I brought an iPhone 4 off my friend at work. The day I brought it, it was working fine but now I can't seem to send any messages or make phone calls. The network is showing up fine but each time I try to make a call it says "call failed" I can't seem to send any messages either? I can use the Internet fine and everything else on the phone. Can anyone help?

    Hi chelsinator,
    You can reset the phone and it won't cause any problems or cause you to lose any data - Hold down the Home and Power buttons at the same time and continue to hold them down until the Silver Apple appears.
    The other thing you should do is to reset your network settings: Settings>General>Reset>Reset Network Settings. You will have to set up your Wifi again, but that oftentimes clears things up.
    Cheers,
    GB

  • I can't make a call but i can received calls and send text messages its say you cannot make a call check the phone settings!

    i can't make a call but i can received calls and send text messages its say you cannot make a call check the phone settings!

    It is not a cell phone.

  • New iphone can't receive or send text messages

    I can't receive or send test messages. I tried turning airplane mode on and off. I also don't seem to have a data plan added to my service. I looked at my contract and it just shows family talk. I thought they automatically add this to iphone contracts.

    It doesn't display an error message. It sends it out, but the recipient never receives it. I think the Best Buy person screwed up my service some how. She didn't sign me up for a data plan or a text message plan for this account. I was supposed to keep my same plan. It should still send texts though (at a higher non-text plan rate).

  • Help!!! I can't receive or send text messages...only imessaging

    How can I get my new iPhone 4s to send and receive text messages?

    Hi, I have a ipod touch 3g with the latest ios 5.  I can't seem to send text messages via the green "message" icon.  The imessage icon is on but it doesn't work....would you know of anything else I can do to allow messages to send and receive??  thanks

  • Can I create pdf files from Outlook 2003 messages with Acrobat XI Standard?

    Can I create pdf files from Outlook 2003 messages with Acrobat XI Standard?

    Yes, Outlook 2003 is compatible with Acrobat XI Standard and you can create PDFs from emails.
    For reference: http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html

  • I can make calls and send text messages on my new iPhone 5, but incoming calls and texts still go to my old (non-Apple) phone. Is this a problem with the phone set up, or is it a problem with my old carrier or my new carrier?

    I can make calls and send texts on my new iPhone 5,  but all incoming calls and texts are received by my old (non-Apple) phone.

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

  • Important! Can IDS 4.1x Send event messages to a syslog server??

    I know IDS event view and MC can pull the IDS event from IDS sensors and IDSM. But our company is think to collect all the security message in a syslog server. firewall can send syslog to this server. But for IDS and IDSM 4.1, I can't find a way to send the IDS event to syslog server. Is there any way to do that????
    I am really appreciate if you can help me,thanks.

    You comment is an easy statement to make, but IMHO unfair.
    If you look at the Cisco IDS/IPS product line's history, you'll realize that the current RDEP/SDEE communications model is infinitely more secure, while remaining easy to use, than any other method one could propose.
    Initially, the sensors pushed events to the centrally monitoring console via UDP (port 45000), with most of the data in the clear (the source and destination IP address were obfuscated). This is obviously not very safe because, even though the communications were pseudo connection-oriented due to checking by the application daemons at each end, it is possible to intercept and modify the IDS alert to inject false data.
    This same problem exists with stock syslog, since everything goes on the wire as a UDP packet and there is no data obfuscation or encryption what so ever.
    The distinct advantage to the current communications model is the fact that RDEP/SDEE use cryptography to protect your IDS/IPS alerts, and that is also uses a standards-based structure in XML-based forms to pass the data.
    Finally, since Cisco has released an SDK for RDEP/SDEE, and many 3rd party vendors have software that can act as RDEP/SDEE clients, I disagree that you’re stuck with the CiscoWorks-based VMS suite. Besides, you only have to buy the suite if you need to manage more than 5 sensors, but I digress...
    Alex Arndt

  • Is my iPad limited to iMessages? I can't seem to send text messages to non iPhone/iMessage users...grrrr

    Frustration is setting in after using my new mini iPad. My text messages seem to be limited to iMessages!?  Horrible since my friends and family are not all iphone users!  Is my iPad limited to iMessages? I cant text my daughter who has the Droid or others that don't have iMessage users!!!

    The phone number on the iPad is not active for cell voice, only for cellular data. You are not paying anything for voice or SMS (texting services) on your iPad, only for cell data. Texts to non-iOS devices would have to be SMS and use the cell voice system which is not present on your iPad.
    There are apps, such as TextFree, which will assign you a virtual phone number and allow you to emulate sending SMS messages from and to your iPad.

  • I can't receive or send text messages, other than iMessage

    i cant receive or send text messages other than i message. HELP.

    Me neither. It is really annoying. Did you ever get it figured out?

  • Can't execute my Sending a message program

    import java.util.*;
    import java.io.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class SendEmail {
    public static void main(String args[])
    /**test if a argument is prompted */
    if (args.length != 0) {
    System.err.println(" 3 arguments required : <username> <password> <emailaddr>");
    /* String username = args[0];
    String password = args[1];
    String emailaddr = args[2];
    String host = "smtp.dial.oleane.com";
    String to = "[email protected]";
    String from = "[email protected]";
    String subject = "test";
    String MessageText = "blabla";
    boolean sessionDebug = true;
    Properties props = new Properties();
    props.put("mail.smtp.host", host);
    props.put("mail.transport.protocol", "smtp");
    Session session = Session.getDefaultInstance(props,null);
    session.setDebug(sessionDebug);
    try{
    System.out.println("titi");
    MimeMessage msg = new MimeMessage(session);
    System.out.println("toto");
    msg.setFrom(new InternetAddress(from));
    InternetAddress[] address = {new InternetAddress(to)};
    msg.setRecipients(Message.RecipientType.TO,address);
    msg.setSubject(subject);
    msg.setSentDate(new java.util.Date());
    msg.setText(MessageText);
    Transport.send(msg);
    catch(MessagingException mex){
    System.out.println("Error on sending a mail ");
    mex.printStackTrace();
    I have an error on the following instruction :
    MimeMessage msg = new MimeMessage(session);
    Atteint exception java.lang.ClassNotFoundException non captur�e
    Can sommebody help me ?
    Thanks a lot

    ah, got the problem. In ur machine the Java Activation Framework is not installed or is not in the classpath. Javamail needs JAF to function.
    Please check. That will effectively solve the problem

  • Can't email or send bbm messages

    Can someone help me please? I use my blackberry from south africa here in canada......everything was fine i used it with wi-fi...but yesterday i took out the simcard....for no reason....and now i cant send or receive emails...and cant bbm my chidren or receive....it keeps on sayin Blackberry ID service temporily unavalable...please it is the only contact i have with them back home!!!

    Hi PetraKobie
    Your SIM card contains all the necessary services for your BlackBerry® smartphone.  If you remove your SIM card, your services will no longer be registered on your device.  This means that without your SIM card, you cannot use any BlackBerry® services such as BBM™.
    Thanks
    -CptS
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • I can only get or send text messages to other iMessage users

    I am not able to receive text messages from people unless they are on IMessage.  Several people have told me they have sent me texts but I am not getting them.  Also, people are not getting my texts.  This has happened since I got my iPhone 4s.

    Yes contact your provider, you most likely do not have texting turned on, they can turn it off,mine is,I can only use i message but wanted it that way, because I do not care to have to pay for the messages people send me
    with i message it is free

  • TS2755 can't receive or send text messages

    I just bought an iPhone 4 and can receive or send messages. What would be wrong?

    If you have just bought the iPhone then unless the carrier stated that you would be good to go from the start, you usually need to wait 24-48hours for your sim to be activated. Contact your carrier if it has been longer than this amount of time. However, you also need to set up your iPhone on iTunes so make sure that you do that!!!

Maybe you are looking for