Using applescript to generate email response

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Using applescript to generate email response Thu Jun 06, 2019 2:10 pm • by lynwyn
Hi. I set up rules to generate an notification email when images are added to a folder. However, it generates one email per image, and I only want it to send one per batch of images. Any suggestions?
lynwyn
 
Posts: 13
Joined: Thu May 16, 2019 4:16 pm

How do you define a batch? If it's all the images in a folder, you can instead match that folder (you'll need to have Hazel monitor the folder that contains it).
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I wanted it to be all the newly added images, however, I generate images into a temporary folder that Hazel monitors and then moves to the appropriate final folder when rules are matched. I assume if I do the correct order of the rules, this can work from the temp folder?
lynwyn
 
Posts: 13
Joined: Thu May 16, 2019 4:16 pm

Note that Hazel has no notion of what you consider a batch. If it's every file in a particular folder, how would you know whatever is generating the files is done? Can you go off of some delay after the last time a file was added? Is there some other indicator you can use?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Batches take less than 10 minutes to create and occur once a day. It's not clear to me how to break this out so it only send one email. It would be nice, but it sounds like perhaps it is not capable of being done.
lynwyn
 
Posts: 13
Joined: Thu May 16, 2019 4:16 pm

If it's once a day, you could use "Current time" to schedule it.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I added Current time is after 4:00PM on a weekday and it continues to send one email per image, so I must not be understanding your instruction
lynwyn
 
Posts: 13
Joined: Thu May 16, 2019 4:16 pm

You still need to match the folder as a whole and not each individual file. Have Hazel monitor the folder that contains those files and have the rule then match that folder (the one containing the files).
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I don't think this will work, it has to look at the metadata in the file to send the email to the correct person. Thanks for your help
lynwyn
 
Posts: 13
Joined: Thu May 16, 2019 4:16 pm

What metadata do you need to access? Do all the files in a folder have the same recipient? Can you post your rule as it stands now?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion