Re: [MlMt] Reply to selected message with AppleScript

2014-11-14 Thread Benny Kjær Nielsen

On 14 Nov 2014, at 10:26, Nick Renders wrote:

I can call AppleScript in Omnis, so I got it working with System 
Events, but I was wondering if there is a better way?


No, I've considered allowing bundle commands to be executed via 
AppleScript (similar to the `performBundleItemWithUUID:` key binding 
selector), but I haven't given it much thought. It might make sense to 
have an AppleScript command which takes the same input as given to a 
custom key binding.


--
Benny
___
mailmate mailing list
mailmate@lists.freron.com
http://lists.freron.com/listinfo/mailmate


Re: [MlMt] Reply to selected message with AppleScript

2014-11-14 Thread Benny Kjær Nielsen

On 14 Nov 2014, at 13:28, Benny Kjær Nielsen wrote:


On 14 Nov 2014, at 10:26, Nick Renders wrote:

I can call AppleScript in Omnis, so I got it working with System 
Events, but I was wondering if there is a better way?


No, I've considered allowing bundle commands to be executed via 
AppleScript (similar to the `performBundleItemWithUUID:` key binding 
selector), but I haven't given it much thought. It might make sense to 
have an AppleScript command which takes the same input as given to a 
custom key binding.


Since I probably won't do something better any time soon I've added a 
`perform` command to the AppleScript API. You should now be able to do 
something like this:


tell application MailMate to perform { toggleFlag: }

Or in your case, you might need something like this:

	tell application MailMate to perform { performBundleItemWithUUID:, 
UUID from bundle command }


You can do anything you can do with [custom key 
bindings](http://manual.mailmate-app.com/custom_key_bindings).


It's available in the current [64 bit beta 
(r5013)](http://updates.mailmate-app.com/archives/MailMate_64bit.tbz).


Have a nice weekend.

--
Benny
___
mailmate mailing list
mailmate@lists.freron.com
http://lists.freron.com/listinfo/mailmate


Re: [MlMt] Reply to selected message with AppleScript

2014-11-13 Thread Nick Renders

Hi Benny,

Thank you for your reply and the example bundle.

The replyMessage action seems to do what I would like, except that the 
message isn't displayed in a new window but is instead automatically 
saved in Drafts.


Can I call bundle commands from another application than MailMate?
I tried to call your bash script from the Terminal, with MailMate open 
in the background, but nothing happened.


Thanks,

Nick


On 9 Nov 2014, at 14:12, Benny Kjær Nielsen wrote:


On 7 Nov 2014, at 13:20, Nick Renders wrote:


I have a question about MailMate and AppleScript.

I would like AppleScript to create a Reply email to the selected 
message
and automatically add some text to it. I understand you can do this 
with
the open location command and setting all the necessary parameters 
like

subject, body and in-reply-to.


Well, that's primarily for new messages and not replies. The 
[`emate`](http://manual.mailmate-app.com/emate) command can also be 
used for this when it's more convenient.


My question is: can I get the value for those parameters for the 
selected

message with AppleScript? Or is there perhaps a better/easier way to
create a Reply email with AppleScript? I have been thinking about 
using the
COM+R shortcut through System Events, but that seems like bit of a 
hassle.


The best way to do this is to use a bundle command. This is still 
badly documented (and incomplete), but it might work well enough for 
you. To help you out I've created a bundle which you should place in 
this folder (create it):


~/Library/Application Support/MailMate/Bundles/

I've added a single command named “Generate Reply”. It calls a 
bash script, but it could be any kind of script (Ruby, Python, 
AppleScript, …). It just has to return a property list specifying a 
`replyMessage` action (as also shown by my example). You can find the 
command in the “Command ▸ Arcict” menu after saving the bundle. 
The only documentation is [this mailing list 
message](http://www.mail-archive.com/mailmate%40lists.freron.com/msg02477.html).


Depending on what exactly you are trying to do, you might need more 
help, but this is a starting point.


--
Benny

[Arcict.mmBundle.zip]
___
mailmate mailing list
mailmate@lists.freron.com
http://lists.freron.com/listinfo/mailmate
___
mailmate mailing list
mailmate@lists.freron.com
http://lists.freron.com/listinfo/mailmate


Re: [MlMt] Reply to selected message with AppleScript

2014-11-13 Thread Benny Kjær Nielsen

On 13 Nov 2014, at 10:55, Nick Renders wrote:


Thank you for your reply and the example bundle.

The replyMessage action seems to do what I would like, except that 
the message isn't displayed in a new window but is instead 
automatically saved in Drafts.


Yes, I should probably add an option to open a composer window.


Can I call bundle commands from another application than MailMate?


No, except for GUI scripting I guess.


I tried to call your bash script from the Terminal,


That won't work.


with MailMate open in the background, but nothing happened.


You want to create a reply to a message selected in MailMate, but 
trigger it from the Terminal? Or are you trying to do something not 
involving selected messages?


--
Benny
___
mailmate mailing list
mailmate@lists.freron.com
http://lists.freron.com/listinfo/mailmate