wpearse

Q: Applescript to delete Messages conversations

I'd like an Applescript that deletes all my iMessage conversations in the Messages app.

 

Could somebody please tell me how to get all my conversations and then delete them using Applescript? Thanks!

OS X Mountain Lion (10.8)

Posted on Jul 17, 2013 8:52 PM

Close

Q: Applescript to delete Messages conversations

  • All replies
  • Helpful answers

  • by Camelot,

    Camelot Camelot Jul 17, 2013 9:35 PM in response to wpearse
    Level 8 (47,243 points)
    Mac OS X
    Jul 17, 2013 9:35 PM in response to wpearse

    Can you clarify your request?

     

    More specifically, explain what you want a script to do differently than the Messages preference option to (not) 'save history when conversations are closed'?

     

    From your description it sounds like the easiest option is to just turn on that preference setting, and your history won't be saved, and therefore won't need to be explicitly deleted.

  • by wpearse,

    wpearse wpearse Jul 17, 2013 9:39 PM in response to Camelot
    Level 1 (0 points)
    Jul 17, 2013 9:39 PM in response to Camelot

    I have an Applescript that automatically sends iMessages to some of my contacts. I have about one hundred different conversations and I would like an easy way to delete those conversations from the Messages app without clicking to close each conversation.

     

    An Applescript seemed like the natural way to do this!

  • by smartcarleen,

    smartcarleen smartcarleen Aug 1, 2016 6:38 AM in response to wpearse
    Level 1 (4 points)
    Aug 1, 2016 6:38 AM in response to wpearse

    I was also searching for an example Apple script to delete old Messages.  I'd like to have the option to delete Messages older than XX days.  Messages only has the option to delete after closing or not at all.