Applying a rule to the parent folder when file inside runs?

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

Moderator: Mr_Noodle

Hi,
I have just started using Hazel (currently still in Trial mode) and am loving it.

It's perfect to organize my Movie collection however here is something I would like to do but cannot figure out how to make happen. Maybe someone here will know how this could work:

Basically I have Hazel apply a colour label of "Orange" to the folder of a newly created folder.
This works great but what I now want to do is:
When I open a media file (for example File.avi) inside a folder marked as "Orange" I would like the colour label "Orange" removed from the folder the file I opened is in.

So something like this:


Before opening a file inside:
Code: Select all
Folder (Orange)
    File.avi

Then a click on the File.avi should make things look like this:
Code: Select all
Folder (No Colour Label anymore)
    File.avi


Is this even possible?

Thanks for reading,
I look forward to your insights.

Jannis
jannis
 
Posts: 4
Joined: Thu Apr 22, 2010 7:25 am

I assume you are familiar with setting up a rule to descend into folders as outlined here? viewtopic.php?f=4&t=470

One way you can do this is to make that rule only go into Orange folders. I'm not sure if you need to descend into folders for other reasons but if not, then this should work.

This article shows how to re-target a rule to operate on the parent folder:
viewtopic.php?p=1545#p1545

I'm looking into ways to handle both of those cases in a better way in a future version but maybe those will help you for now.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:I assume you are familiar with setting up a rule to descend into folders as outlined here? viewtopic.php?f=4&t=470

One way you can do this is to make that rule only go into Orange folders. I'm not sure if you need to descend into folders for other reasons but if not, then this should work.

This article shows how to re-target a rule to operate on the parent folder:
viewtopic.php?p=1545#p1545

I'm looking into ways to handle both of those cases in a better way in a future version but maybe those will help you for now.



Thanks,
Yes I did read the thread about the subfolder traversing but I didn't know how to get 'out of it' again. I have saved the script as a applescript .scpt file and will experiment a little with it tonight.

Cheers,
Jannis

PS: I think if you could build this feature in, in a future release, that would make Hazel even more powerful than it already is.
jannis
 
Posts: 4
Joined: Thu Apr 22, 2010 7:25 am

Still trying to figure this one out.. could you perhaps give me some pointers if this could work?

Here is my initial script that runs on a newly added folder to mark it orange (works)
Image


Then I need to setup something that will watch for if I open a file inside this folder with an AVI ext. (untested)
Image

Then there seems to be no way to add a 'if file is opened inside subfolder' action once the previous has run so I am thinking this might work?
Image

Any idea if I am on the right path here?

Thanks,
Jannis
jannis
 
Posts: 4
Joined: Thu Apr 22, 2010 7:25 am

I have finally figured out how to get my orange label to apply to newly added files in subfolder, what I cannot seem to grasp is how to set 'me opening the avi file' as a trigger?

I thought I could hook into 'Last Opened' but this does not work, it seems media files (.avi in this case) do not record access time.. is there any way I can hook into the double clicking/opening the .avi file?

Thanks, loving Hazel, totally buying a license for it.


UPDATE:
I just figured it out, the reason it was not working for me was that the file while "Last Opened" was resulting in = true, the previous rule 'mark as orange was also being applied' so I was effectively removing the label and reapplying the orange one it was meant to remove.
Adding in a condition of 'mark orange' to only run if the color label is not set and not orange, did the trick.
jannis
 
Posts: 4
Joined: Thu Apr 22, 2010 7:25 am


Return to Support

cron