|
|
Hiding Files In Mac OS X?
|
|
|
|
ncmason
|
|
I am trying to make an AppleScript that will hide files. I am aware of the "Developer/Tools/SetFile -a V" command for hiding files through Terminal, but had no idea how to use this in an AppleScript. Any suggestions?
Thanks,
Mason
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status:
Offline
|
|
do shell script "Developer/Tools/SetFile -a V"
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
You can also simply append a dot to the beginning of the name (e.g., rename "myfile.txt" to ".myfile.txt"). This will also make it invisible on the command-line as well.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
ncmason
|
|
Originally Posted by mduell
do shell script "Developer/Tools/SetFile -a V"
My plan was that I would use this AppleScript in Automator so I can save it as a plug-in for Finder. I have tried it but it doesn't seem to work. What do I need to add to the AppleScript to make compatible as an Automator Workflow?
Thanks,
Mason
|
|
|
|
|
|
|
|
|
ncmason
|
|
Originally Posted by Chuckit
You can also simply append a dot to the beginning of the name (e.g., rename "myfile.txt" to ".myfile.txt"). This will also make it invisible on the command-line as well.
I've tried that and Finder won't allow me to do that. Here is a screenshot of what comes up when I add a "." to the name:
(
Last edited by ncmason; May 5, 2007 at 09:46 PM.
)
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status:
Offline
|
|
Yep, the Finder will intercept that, but any shell will let you do it.
mv foo.bar .foo.bar
|
•
|
|
|
|
|
|
|
|
Junior Member
Join Date: Jul 2005
Location: N.Ireland
Status:
Offline
|
|
Ye, as simon said use mv command in terminal.
You can use ls -la to view any hidden files. But you won't be able to find it on spotlight, so you'd better remember where your files are. You can use find command to hunt it, but it would take ages.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
There are also advantages to scripting shell commands and scheduling them via cron. For one, I'm not sure that Applescripts can run faceless? Do they provide console output on error?
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
David Copperfield is a master of knowing how to hide his files... some might say it is.... magic!
|
|
|
|
|
|
|
|
|
ncmason
|
|
How can I make it so that it is an Automator workflow?
Thanks,
Mason
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
In Automator, make a Run AppleScript action, and enter this script into it:
code:
on run {input, parameters}
set thePath to POSIX path of (input as string)
do shell script "/Developer/Tools/SetFile -a V '" & thePath & "'"
return input
end run
(
Last edited by CharlesS; May 6, 2007 at 01:50 PM.
)
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Jul 2005
Location: N.Ireland
Status:
Offline
|
|
Originally Posted by besson3c
David Copperfield is a master of knowing how to hide his files... some might say it is.... magic!
Storm, fire, earth, hidden files, heed my call!
|
|
|
|
|
|
|
|
|
ncmason
|
|
Originally Posted by CharlesS
In Automator, make a Run AppleScript action, and enter this script into it:
on run {input, parameters}
set thePath to POSIX path of (input as string)
do shell script "/Developer/Tools/SetFile -a V '" & thePath & "'"
return input
end run
edit: okay, formatting is messed up for that snippet since for some reason, the code tag still doesn't work on this board. God forbid it be possible to post code here! After all, this board isn't for technical discussions, it's for talking about whether things are "snappy" or whether "I'd hit it"!
It worked! Thank you so much
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by CharlesS
edit: okay, formatting is messed up for that snippet since for some reason, the code tag still doesn't work on this board. God forbid it be possible to post code here! After all, this board isn't for technical discussions, it's for talking about whether things are "snappy" or whether "I'd hit it"!
So, would you hit it?
*ducks*
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
Originally Posted by besson3c
So, would you hit it?
*ducks*
Hmm, I've partially figured it out. Apparently, the code tag has been renamed to [codeff] instead of [code] for some reason (just to be confusing?). However, it's still ignoring my line indents. Off to the feedback forum...
(
Last edited by CharlesS; May 6, 2007 at 01:52 PM.
)
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally Posted by CharlesS
I'd hit whoever decided to disable the code tag - in the face.
Seriously, I wish someone would explain to me why that decision was made, because it makes no sense to me at all.
It was a mistake, I think, where it was being redesigned and Frank just forgot to finish it. There's still a preliminary version of the tag available as [codex].
[codex]See?[/codex]
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
[codex]practicing writing code[/codex]
[codex]more code[/codex]
[codex]Here is some more code: 24hfh1s33^^[/codex]
Awesome!
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
[codex]#include <stdio.h>
int main (int argc, const char * argv[]) {
printf("This should be indented!\n");
return 0;
}[/codex]
[codex]set thePath to "Macintosh HD:Users:me ocuments:file.txt"[/codex]
[codex]NSData *myData = [NSData dataWithContentsOfFile athToFile];[/codex]
Not so awesome.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally Posted by CharlesS
Not so awesome.
I don't think the old code tag turned off the auto-smilies feature either.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
Originally Posted by Chuckit
I don't think the old code tag turned off the auto-smilies feature either.
I seem to remember it doing that, but of course now it's not possible for me to check, so who knows.
I do remember that it definitely did display indentations if you had tabs or other white space in the code.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Auto smilies? That would be awesome!
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Jan 2003
Location: ~/
Status:
Offline
|
|
[codex]
Hide pr0n /shemales/videos/hardcore
[/codex]
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2000
Location: Allston, MA, USA
Status:
Offline
|
|
Also, I have noticed sometimes the Finder needs to be restarted to recognize that the files are now set to be invisible. Actually, I think it's usually folders that requires a Finder restart.
|
-- Jason
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: May 2007
Location: pyo
Status:
Offline
|
|
Iunno about plugins for Automator, but I keep this in my dock, pyo.
Hide'N'Seek
I made it out of a few different pieces of applescripts I found out thar on teh internets, and it's what I use to hide my secret cookie recipes from the nosy neighbor lady, pyo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|