Re: Make a file visible
Re: Make a file visible
- Subject: Re: Make a file visible
- From: Thomas <email@hidden>
- Date: Sun, 15 Dec 2002 20:05:40 +0100
I have the developer tools installed but I wanted the script to help
people around and they're not supposed to have it installed. I would
also need to be able to trash invisible files which name start with a
period.
In fact I was looking for a script that will trash under OS X all the
nasty (ressources ?) files "._<name of the file>" which appears when you
copy files on a DOS disk from OS X.
(for example if you drag a file named "Sound.mp3" on a DOS disk, you'll
also get a "._Sound.mp3", generaly a 2 ko file).
Thanks Thomas
Doug McNutt wrote :
Naah. Shell scripting is much easier than AppleScript. The UNIX man
pages are far easier to understand than a typical scripting dictionary.
(Complex only means SQRT(-1) around here.)
This can be saved as an Application and will operate on files dropped
onto it. It can be tested by selecting a file in the finder and then
running the script in the Script Editor. You do need to install the
developer tools but everyone ought to do that.
This is set up to make a file INvisible. I'm not sure how one would
select an invisible file on which to operate. Of course that's trivial
in the Terminal window but then you don't need an AppleScript anyway.
If it's a known file you should be able to throw away a lot of the
script and just type in its folder and name.
--Begin sample code
-- This section runs while in the script editor.
-- Starting point is selection in the finder.
tell application "Finder"
set argList to selection
end tell
repeat with aTarget in argList
set anAlias to aTarget as alias
doStuff(anAlias)
end repeat
-- This happens when icons are dropped onto the script in Applet form.
-- Note that finder resolves any aliases even though it delivers alis's
in arglist.
on open (argList)
repeat with anAlias in argList
doStuff(anAlias)
end repeat
end open
on doStuff(theAlias)
set thePath to POSIX path of theAlias
do shell script "/Developer/Tools/SetFile -a V " & thePath
-- A lower case v will make files visible. Watch the following space
end doStuff
--
--> There are 10 kinds of people: those who understand binary, and
those who don't <--
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.