Hidden files and folders (incl. use case)

From your noodle to other noodles. Talk about ways to get the most from Hazel. Even exchange recipes for the cool rules you've thought up. DO NOT POST YOUR QUESTIONS HERE.

Moderators: Mr_Noodle, Moderators

Hidden files and folders (incl. use case) Thu Apr 24, 2008 4:19 pm • by kriro
Hello,

from reading forum posts, I am currently concluding that it is impossible to handle hidden (invisible) files with Hazel. Is this correct?

My use case (actually the very first filter I tried to implement) is as follows:

I often get sent folders of source code. Often, users send a zip file, including the invisible subversion meta information folders, which are in each source code folders. Those folders have the name ".svn". My goal is a simple one: Remove all .svn folders from the folders of files I get sent recursively.

My first try therefore looked like this:

Rule #1, "Delete .svn info":
Code: Select all
If [all] of the following conditions are met
[Full name] [is] [.svn]
[Kind] [is] [Folder]
do the following:
[Move file] to folder: [Trash]


Rule #2, "recurse":
Code: Select all
If [all] of the following conditions are met
[Kind] [is] [Folder]
do the following:
[Run rules on folder contents]


I figured that this set applied to incoming source code folders would delete all .svn folders contained therein. However, in the "Preview Rule Matches" window, none of the existing .svn folders in my test setup are even displayed, not to mention showing their rule status.

What I would suggest is to make it an option whether hidden files/folders should be automatically excluded (certainly the default setting), or if Hazel works on all files for that specific folder rule. I think in the latter case, I can still exclude all important files from being touched by including a first rule in the list that excludes e.g. handling of all known system files or simply do a "exclude if hidden and not '.svn'".

I hope I was able to demonstrate a legitimate use case for re-considering what seems to be the current handling of hidden files.

If I am missing something and I can already easily do what I want with Hazel as it is now, I'd highly appreciate to learn how.

Regards, Christian
kriro
 
Posts: 3
Joined: Thu Apr 24, 2008 4:00 pm

Hi Christian,

You are correct. Invisible files are ignored. In the early days, there was some confusion over them. Plus, many invisible files tend to be some sort of metadata for the folder they are in (such as folder icons or even .svn directories) so I thought it would be bad form to have Hazel move them since they wouldn't notice until much later.

I've added your suggestion to the feature db for future consideration. In the meantime, you can try something like "If Kind is Folder, Run shellscript" where the script would remove the .svn directory. Not as "clean" but I think it should work.
Mr_Noodle
Site Admin
 
Posts: 8571
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Hidden files and folders (incl. use case) Sat Apr 26, 2008 12:38 pm • by kriro
Thanks. I'll try the shell script route for now.

-Christian
kriro
 
Posts: 3
Joined: Thu Apr 24, 2008 4:00 pm

Re: Hidden files and folders (incl. use case) Tue Jun 03, 2008 6:15 pm • by sjk
kriro wrote:I'll try the shell script route for now.

That's what I've done, though I'd still prefer if Hazel could access hidden files directly by enabling a preference (e.g. with "defaults write …").
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene


Return to Tips & Tricks - DO NOT POST QUESTIONS

cron