• 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: visible of window bug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: visible of window bug


  • Subject: Re: visible of window bug
  • From: kai <email@hidden>
  • Date: Mon, 6 Nov 2006 23:11:31 +0000


On 6 Nov 2006, at 15:40, Luther Fuller wrote:

My script said ...

	set appSup to (path to application support from user domain) as alias
	...
	else if visible of window of folder "Folder Name" of appSup then
		my doSomeStuff()
	dnd if

but other parts of the script were not working properly. Finally, I found the problem and wrote this to fix the it ...

	set appSup to (path to application support from user domain) as alias
	...
	else
		try
			visible of window of folder "Folder Name" of appSup
			if the result then my doSomeStuff()
		end try
	end if

It seems that 'visible of window ...' requires the window to be visible in order to return a boolean result, otherwise it errors. Illogical!

I'm not sure that I'd use this test to achieve what (I think) you're after, Luther.


The visible property of an open Finder window is always true. As you've found, an attempt to get the visible property of an unopened Finder window will fail. Specifically, it results in an Apple Event failure: error number -10000 ["The window must be opened to get this property."]

An existence test might therefore be more appropriate for your purposes:

----------

set appSup to path to application support from user domain

tell application "Finder"
if exists window of folder "Folder Name" of appSup then my doSomeStuff()
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/mailman//archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: visible of window bug
      • From: Luther Fuller <email@hidden>
References: 
 >visible of window bug (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Find server name of mounted volume
  • Next by Date: Re: visible of window bug
  • Previous by thread: visible of window bug
  • Next by thread: Re: visible of window bug
  • Index(es):
    • Date
    • Thread