Page 1 of 1

How to move a file after some time it has been opened?

PostPosted: Thu Jul 14, 2022 3:45 am
by IvanPsy
Greetings,
I've set up a rule that look for .dmg files into a folder, and, if it has been opened, after some time Hazel move it to the trash.

Alas the rule trashes the file as soon as I download it.

How do I solve it?

I've tried by using last opened "is before" and "is not in the last", but I wasn't able to solve.

Thank you!

Re: How to move a file after some time it has been opened?

PostPosted: Thu Jul 14, 2022 8:20 am
by Mr_Noodle
Select the file in Finder and do "Get Info". Make sure there is a "Last opened" date set (it should be under "More Info").

Re: How to move a file after some time it has been opened?

PostPosted: Thu Jul 14, 2022 9:05 am
by IvanPsy
Mr_Noodle wrote:Select the file in Finder and do "Get Info". Make sure there is a "Last opened" date set (it should be under "More Info").


No "Last opened" date set when I download the DMG from the website.
It appears after I have opened it, of course, but it's too late because Hazel trashes it the moment the file is downloaded.

So how do I make Hazel trash it only after the file has been opened?
Is it possible?
How?
Maybe some workaround?

Thank you.

Re: How to move a file after some time it has been opened?

PostPosted: Thu Jul 14, 2022 9:29 am
by AlanRalph
Your rule is matching the newly-downloaded file because the blank last-opened-date matches the condition you've set.

You'll need to change to filter out the blank last-opened-date. In other words, for instance:

If all of the following conditions are met
Kind is Disk Image
Date last opened is not blank
Date last opened is not within last 1 day

Note that the order of those conditions is important — if the second one is false, which it should be for a file you've just downloaded, then the rule won't match.

I hope that helps, I know I've had similar situations where it took me a while to work out why the rule was running when I didn't want it to.

Re: How to move a file after some time it has been opened?

PostPosted: Thu Jul 14, 2022 9:58 am
by IvanPsy
AlanRalph wrote:Your rule is matching the newly-downloaded file because the blank last-opened-date matches the condition you've set.

You'll need to change to filter out the blank last-opened-date. In other words, for instance:

If all of the following conditions are met
Kind is Disk Image
Date last opened is not blank
Date last opened is not within last 1 day

Note that the order of those conditions is important — if the second one is false, which it should be for a file you've just downloaded, then the rule won't match.

I hope that helps, I know I've had similar situations where it took me a while to work out why the rule was running when I didn't want it to.


Done, let's see how it works.
Thank you!