Hello, maybe someone can prove (or not) the following behavior in automator app:
I made a folder action attached to the Download folder to mark downloaded files from a specified time ago with a tag. It works - lets say - in parts. To get the files I chose the creation date as filter. Automator pick not only all old files but also some just downloaded files as well. Referring the creation date I thought it mean date/time the file was downloaded but this might not be reliable. As a test I downloaded the daily google search form picture and it was taggedâŚ
have you tried having Hazel monitor the folder? âdate addedâ would be the trigger needed. I donât know whether automator is your best option here. (but might be wrong)
Automator is not broken, I think you are using the wrong filter.
The reason is that the creation date of the file is not the same as the download date. The site where you downloaded the file from could have made this file two years ago, so the file has that date as creation date.
In Finder there is also possibility to sort on Date Added.
I donât know Automator well enough to know if you can use that as a filter.
The reason is that the creation date of the file is not the same as the download date. The site where you downloaded the file from could have made this file two years ago, so the file has that date as creation date.
The one thing that Iâd add is that the reason youâre only sometimes getting this tag on newly downloaded files is that when it comes to metadata, like the file creation date, moving files over the internet is kind of a crapshoot. Depending on what mechanism you use and where you download the file from sometimes youâll get the metadata and sometimes you wonât. If you donât get the metadata, the file creation date will be the same as the download date. If you do get the metadata, the file creation date may not match when you downloaded it.
@FrankV@ChrisUpchurch thank you both for clarifying this to me. Unfortunately automator does not have the Added Date trigger. But I found a nice script to read out the Added Date. If I will get it to work I will post it here for reference. In practice I will stick to hazel.
The nice thing about Automator is that you can also use code snippets from Shell scripts, AppleScript and other languages (like Python) to do a task.
This is an example of an AppleScript, combined with Shell Script, that you can use in Automater. It gives you the DateAdded in the format yyyymmdd
Add the below to a âRun AppleScriptâ action.
on run {input, parameters}
set FileDetails to (the POSIX path of input)
set FileDate to do shell script "mdls -name kMDItemDateAdded " & FileDetails & " | awk '{print $3}'|sed -e 's#-##g' "
return FileDate
end run
I guess it can also be a Shell Script action only, but Iâm more familiar with AppleScript.
Over the years, Iâve found that itâs easier to troubleshoot Hazel than it is to troubleshoot Folder Actions. Sometimes Iâve spent hours trying to tweak Folder Actions so they work the way I want them to.