Running KM in Mail.app

I want to print specific emails to PDF on their arrival in my inbox, and then process them using Hazel.

I've a KM macro that works - just not in the Mail.app rules engine (it beeps when it tries to run):

tell application "Keyboard Maestro Engine"
do script "376546DE-E118-462E-8A0D-71E8348DA900"
-- or: do script "PDF Print"
-- or: do script "376546DE-E118-462E-8A0D-71E8348DA900" with parameter "Whatever"
end tell

Is the Mail.app rules engine flaky, or am I missing something?

Thanks,

Des

Mail rules are, if not flaky, a challenge to make work as expected.
The issue is most likely getting a proper reference to the PDF attachement that KM can use.

I'd suggest this process:

  1. Create a Mail rule that uses AppleScript to save the PDF attachment(s) to a specific folder that KM watches.
  2. Set the KM Macro trigger to use Folder trigger
    1. When the PDF file is added, this will trigger the macro
    2. This will give you the full path to the PDF, which you should be able to use for your processing.

Questions?

Not PDF attachments - I want to run a rule to print the email to PDF and that's the process that I'm having an issue with.

Thanks,

Des

Hey Des,

Mail rules are generally pretty solid – BUT AppleScripts in Mail rules are indeed VERY flaky – since Mavericks... (Bad Apple!)

-Chris