deletion of a file

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

Moderator: Mr_Noodle

deletion of a file Tue May 20, 2008 3:19 pm • by greguk11
hi

im using hazel to clear my downloads folder

i want it to move any files to trash that i have opened and no longer need (did not move them or hazel did not move them)

so i set up the following rule:
Image

but it removes all files immediatly

is this because there is no last opened date when the file is made and therefore it just deletes it? If so, is there any other way to do it? i tried date created but got the same results

thanks
greguk11
 
Posts: 2
Joined: Tue May 20, 2008 3:06 pm

Re: deletion of a file Tue May 20, 2008 10:32 pm • by Mr_Noodle
You can try checking for a "blank" date. Certain attributes may have no value because they were never set so checking for blank may be the best way to deal with those cases.

In your case, you probably want something like "Date Last Opened is not blank AND Date Last Opened is not in the last 1 hour". Play with that and see if how that works for you.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: deletion of a file Wed May 21, 2008 3:53 am • by alastor933
Certain attributes may have no value because they were never set so checking for blank may be the best way to deal with those cases.

When I started playing with the Spotlight/SpotMeta/Hazel troika, I tried to find files without a Spotlight comment. Sometimes I would find a few, but these would then not show up in a later search. Using mdfind I found that these items would have an empty Spotlight comment, that later disappeared.
So I believe that you cannot have empty/blank attributes, they will be removed sometime after their value was removed. Is this assumption correct? If correct, an attribute that was never set has never existed.

Now I see Hazel does 'attribute is blank'. Does this mean there is a way to check whether an attribute exists? You may have taught Hazel how to do this, but I'd like to be able to do it on my own...
alastor933
 
Posts: 53
Joined: Wed Mar 05, 2008 3:52 pm
Location: Utrecht, Netherlands

Re: deletion of a file Sat May 24, 2008 11:05 am • by greguk11
i switched to using date created/modified as i might not open all of the files

the problem is though that mac doesnt update date created/modified when you save a file from the internet

it keeps the date created of the file on the server rather than when it was created on your computer

so hazel will always delete the files, is there anyway around this to make hazel update the date created/touch the file before it runs the second rule

thanks
greguk11
 
Posts: 2
Joined: Tue May 20, 2008 3:06 pm

Re: deletion of a file Mon May 26, 2008 12:02 pm • by Mr_Noodle
Have you considered using "Date Added"? This is a field recorded by Hazel just for situations where you want to know how long a file has been sitting there.

If you want to touch the file, you can have Hazel trigger a shellscript that calls touch. Something like this:

Code: Select all
#!/bin/sh

touch $1


That said, you may want to look into using "Date Added" first.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support