Re: Make a file visible
Re: Make a file visible
- Subject: Re: Make a file visible
- From: Doug McNutt <email@hidden>
- Date: Sun, 15 Dec 2002 11:48:35 -0700
At 18:26 +0100 12/15/02, Thomas wrote:
>
Too complex ! I give up.
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.