• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Folder Access, invisibility
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder Access, invisibility


  • Subject: Re: Folder Access, invisibility
  • From: kai <email@hidden>
  • Date: Tue, 3 Apr 2007 00:16:42 +0100


On 2 Apr 2007, at 23:41, Michelle Steiner wrote:

On Apr 2, 2007, at 1:58 PM, Arnaud Nicolet wrote:

Well, you're changing the name of the folder.
I think it would be more appropriate to change the visible property (every item in the Finder has that property).

OK, try this:

set a to choose folder
tell application "System Events"
	set visible of a to false
end tell

Only thing is that after the script is run, the folder has to be selected, it's enclosing folder closed and then reopened. If the folder isn't selected, it doesn't work for some reason.

Fine. Does the Update command (Finder) not work for this issue?

It didn't make any difference whether it was in the script or not.


My own experience differs somewhat, although this may be down to slight variations in configuration or testing method. However, the behaviour here squares with that described by Michelle in several respects.

If the window of the target's container is kept open, then the target's appearance doesn't alter. (Actually, it may appear to fade slightly when its visibility property is set to true - but otherwise, it appears to be unchanged.) So the container's window must be closed and reopened for the target's appearance to change. (When performing this operation by script, it's necessary to make sure the window has completely closed - otherwise reopening may sometimes fail.)

When the window is already closed, the change is made correctly; this can be visually confirmed when the container is next opened.

However, I don't need to select the target to effect a change.

The following script demonstrates what works pretty consistently here. To allow for easier monitoring, the target is selected only on the first run, and its visibility is toggled thereafter.

------------

property f : missing value
if f is missing value then set f to choose folder with invisibles
tell application "System Events" to set f's visible to not f's visible
tell application "Finder"
	update f
	-- return (* uncomment to keep window open *)
	tell (get f's container) to if its window exists then
		close its window
		repeat while its window exists
			delay 0.1
		end repeat
		open
	end if
end tell

------------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Folder Access, invisibility (From: "Stockly, Ed" <email@hidden>)
 >Re: Folder Access, invisibility (From: Michelle Steiner <email@hidden>)
 >Re: Folder Access, invisibility (From: Arnaud Nicolet <email@hidden>)
 >Re: Folder Access, invisibility (From: Michelle Steiner <email@hidden>)
 >Re: Folder Access, invisibility (From: Arnaud Nicolet <email@hidden>)
 >Re: Folder Access, invisibility (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Folder Access, invisibility
  • Next by Date: EPS to WMF or other vector file format for MS WORD [was: Re: Quietly Distill a file]
  • Previous by thread: Re: Folder Access, invisibility
  • Next by thread: Re: Folder Access, invisibility
  • Index(es):
    • Date
    • Thread