change attributes (visible) for all files in a folder (and even deeper would be nice)

22 views
Skip to first unread message

phillman5

unread,
Jan 2, 2012, 4:16:29 AM1/2/12
to Blacktree: Quicksilver
I confess I am completely new to QS, I did look at the manual, and
searched the forum first. I have folder full of folders, but only two
deep, but all files at the second level are invisible. I see QS can
make a file visible, any way to have it make all files within the
folders at the second level visible?

folder A
folder 1
file 1
file 2
folder 2
file 1
folder B
folder 1
file 1
file 2
folder 2
file 1

any other suggestion would be appreciated

Jon Stovell

unread,
Jan 3, 2012, 12:13:53 AM1/3/12
to Blacktree: Quicksilver
The comma trick should be helpful here.

phillman5

unread,
Jan 3, 2012, 2:39:36 AM1/3/12
to Blacktree: Quicksilver
Jon,
Ok, what's the comma trick?
Paul

Rob McBroom

unread,
Jan 3, 2012, 9:13:20 AM1/3/12
to blacktree-...@googlegroups.com
On Jan 3, 2012, at 2:39 AM, phillman5 wrote:

> Ok, what's the comma trick?

You can select multiple things (including files) in Quicksilver by getting the first one, hitting comma, getting the next one, etc. until you’ve selected the last one. You can also select everything on the results list using ⌘A, which would be helpful if you want everything in the folder.

In theory, you could get everything in one folder, then go to another and get all those files, etc. but one mistake and you’re starting over. This would probably be easier in Terminal with something like `some_command */*/*` (but I’m comfortable in the Terminal).

--
Rob McBroom
<http://www.skurfer.com/>

Daniel

unread,
Jan 5, 2012, 11:39:12 AM1/5/12
to Blacktree: Quicksilver
As far as Terminal goes—which is the way I would do it—the command is
`SetFile -a v <files>`. However if any of the files have spaces in
their names (which they might), it's not going to be safe to just do
`SetFile -a v */*/*`. You'll probably need to use an old staple of the
command line, find/xargs.

find -X <folder> -depth 2 -print0 | xargs -0 SetFile -a v

The "-depth 2" option says "only print files whose depth from <folder>
is exactly 2 (i.e. <folder>/*/* but not <folder>/*, although SetFile
is safe to use on files that are already visible)". Change that value
as you wish (+n or -n for greater-than or less-than), or leave it out
for infinite traversal. "-print0 | -0" is what makes it safe with
spaces (-X is also there to work with xargs, to be extra safe).

You could also save this code to an AppleScript file in ~/Library/
Application Support/Quicksilver/Actions to be able to do this to any
folder (to infinite depth, although you could put back the -depth
parameter to set that—it just seems less useful in a generic action,
rather than a one-time command):

on open theFolder
if folder of (info for theFolder) is true then
do shell script "find -X " & (quoted form of POSIX path of
theFolder) & " -print0 | xargs -0 SetFile -a v"
else
do shell script "SetFile -a v " & (quoted form of POSIX path of
theFolder)
end if
return theFolder
end open

change -a v to -a V to make things _in_visible, or `man SetFile` for
more attributes you can set.

phillman5

unread,
Jan 6, 2012, 8:08:29 PM1/6/12
to Blacktree: Quicksilver
Hey, thanks Rob and Daniel!

I did find a good source of terminal commands on the web and was
successful. Although SetFile is useful there is another command to do
the same which doesn't require Apple's Dev kit, its chflags . I
also found some hints on using find and sending filenames with
spaces to an application thats more 'portable', it uses {} but I don't
remember exactly now what it is, and I am at work not home.

thanks again.
Reply all
Reply to author
Forward
0 new messages