Can Finder make a file visible or not?

As object, can Finder change visibility of a file? I’ve googled but I have find only visible yes/not of a window, element, etc… nothing regarding a file.
So I’ve tried this


(* this_item is a file or folder fo my user *)
tell application "Finder" to set visible of this_item to false

But it gives me an error


(* this_item is a file or folder fo my user *)
set visible of ithis_item to true

And this gives me “Stack Overflow”

Wich MacOS app can make this for me?

Tnx in advance

visible is a property of file info (in Standard Additions) but it is “get” only. “Invisibles” from a system perspective are files whose names begin with a period, like “.DS_Store”

Hi 1802

Found this over at macosxhints:

display dialog "Set the visibility of hidden files..." buttons {"Cancel", "Visible", "Invisible"} default button 1
copy the result as list to {buttonpressed}
if the buttonpressed is "Invisible" then
	try
		tell application "Finder" to quit
		do shell script "defaults write com.apple.finder AppleShowAllFiles OFF"
		delay 1
		tell application "Finder" to activate
	end try
else if the buttonpressed is "Visible" then
	try
		tell application "Finder" to quit
		do shell script "defaults write com.apple.finder AppleShowAllFiles ON"
		delay 1
		tell application "Finder" to activate
	end try
end if

check it out here: http://www.macosxhints.com/article.php?story=20030409015020645
there might be something there that works for you!!

That doesn’t alter the visibility flag of a file; it just tells the Finder to show invisible items.

You can use “do shell script” with the SetFile utility, which is included with the Developer Tools, to flip the visibility flag of items on disk.

Hi Mikey-San.
Thanx for tips. I’ve cecked the SetFile utility: it appears right as I ask.

Here the solution

(* SetFile utility is under the dropplet, and this_item is the item: item is visible and goes invisible *)

set SetFile to the quoted form of POSIX path of (path to resource "SetFile")
set t_item to the quoted form of POSIX path of this_item
do shell script (SetFile & space & "-a V" & space & t_item)

or

(* SetFile utility is under the dropplet, and this_item is the item: item is visible and goes invisible *)

set SetFile to the quoted form of POSIX path of (path to resource "SetFile")
set t_item to the quoted form of POSIX path of this_item
do shell script (SetFile & space & "-a v" & space & t_item)

I posted some code on this in the code exchange section. You can see it here…

http://bbs.applescript.net/viewtopic.php?id=19260