Need help setup daily task finad latest jpg and mail

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hello,
well i'm new to Hazel and i need quick help...
here is what i need:
I have a Webcam that saves every 60 sec a jpg in a new folder for every day.
Now i want to get @ 9.00 every day the latest saved image from the cam and sent it by mail to specific address.

a possibility is that i use a folder action on a specific folder that sent me a new added file with mail...
that part works but is it also simple possible with Hazel ?

And how can i set up a daily task @ 9.00 to get the last image save to a subfolder ?

many many thanxxx
i'm bit in stress sry but Hazel seams to be the solution !
thx
Stefan
MadMAc
 
Posts: 4
Joined: Wed Aug 08, 2012 4:07 pm

Please do not post questions in the Tips forum. There's a sticky article at the top telling you not to.

To schedule a task, check out the "Current time" attribute. For emailing, you need to use an Automator action as Hazel doesn't have a built-in email action.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hello,
so again this is what i have:
A Webcam that saves every 1 minute a image (.jpg) in a folder of the Day (each Day a folder created by Webcam)
Now i want to get the last image at 12.00 a clock every Day and sent it via Mail.

well can't get it to work....
The Problem are the Subfolders....
here is what do now:

If all of the following conditions are met for any of its sub-files or folders
Current Time is at 12.00 any day
Extension is jpg
Date Created is in the last 1 minute

Do the following to the matched file or folder:
Run Apple Script (My Mail Script that takes theFile as a attachment and sent it via Mail) that part works... :-)


Hope someone can help me... many thanks

Stefan
MadMAc
 
Posts: 4
Joined: Wed Aug 08, 2012 4:07 pm

The way you have it now, it is matching folders that contain jpgs, not the jpgs themselves. Do not use the any subfiles target for this. See the sticky up top on how to get at the files inside subfolders.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Damn Yes .... i still was blind sry
got it work now... Thank You !!!
but now it try to sent dozent pictures... it doesn't stop
How can i tell it should only do the task once ?
Many Thanks

Stefan
MadMAc
 
Posts: 4
Joined: Wed Aug 08, 2012 4:07 pm

Not sure. Are you sure your script is executing without error? Maybe there's an error at the very end so that it ends up re-running things?
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Not sure. Are you sure your script is executing without error? Maybe there's an error at the very end so that it ends up re-running things?


here is my script:
Code: Select all
set theSubject to "new subject"
set theBody to "this is the message body"
set theSender to "Joe"
set theName to "Bill"
set theAddress to "email@domain.com"
set theAttachment to theFile

tell application "Mail"
   set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
   tell newMessage
      set visible to true
      set sender to theSender
      make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
      tell content
         make new attachment with properties {file name:theFile as alias} at after the last paragraph
      end tell
   end tell
   activate
end tell


the problem is still that it runs over and over again...
i only need to do it one time a day and only one picture...
thank you

Stefan
MadMAc
 
Posts: 4
Joined: Wed Aug 08, 2012 4:07 pm

Can you check the logs? See if there's an error occurring there.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron