Page 1 of 1

Responding to an answered question

PostPosted: Sat Mar 11, 2017 9:40 am
by Cool Angus
Okay, very new on here, so please forgive if this is already answered somewhere. I have searched as best I could both on here and other resources, but could not find an answer that works.

I have created a simple rule that identifies a file kind of PDF in my Downloads folder, copies it to Evernote, then moves it into a PDF subfolder within the Downloads folder. So far so good!

What I am trying to achieve is an earlier step, such that when the PDF enters the Download folder, first Hazel presents me with a dialog box asking, "Do you want to copy this to Evernote?" Then if I answer "Yes" it does exactly what my simple rule already does. However, if I answer "No", then Hazel would not make the Evernote copy, just move it to the PDF folder.

So, I need Hazel to give me a dialog, so I can answer the question, then Hazel can continue. But how?

I have tried using an AppleScript condition like this;

display dialog "Send PDF to Evernote?" buttons {"Yes", "No"}
set pdf_answer to button returned of result
if pdf_answer is "Yes" then return true
end if
return false

But, this fails with a Hazel error.

Any ideas appreciated....

Re: Responding to an answered question

PostPosted: Mon Mar 13, 2017 11:24 am
by Mr_Noodle
You probably want to implement this in an action, not a condition. Search the help for AppleScript.

There is the hazelStop variable which you can set. It needs to be in a record that you return. Something like:
Code: Select all
    return { hazelStop: flag }


If flag is set, then Hazel will stop processing the file.