Seeing if a window is visible

I have an app in XCode with a window that shows when it starts up if the app is unpaid for. If it is paid for, that window never pops up. If the app is unpaid for I want the app to do something. So basically, if that window is there, then i want it to do something. How can i see if a window is visible in Applescript? i tried:

	tell "MainMenu.nib"
		if visible of window "Unregistered!" = true then
			-- do this
		end if
	end tell

but it gets an error… any help?

I’m sure others around here know more and I’m not certain but it might be that the visible holds a value of 1 or 0 instead of a boolean true or false. try substituting 1 for true and 0 for false and see how that works out.

Ya, i got the answer. 1 = true and 0 = false depending on the variables class type. Thanks though!

I feel like Zoidberg from Futurama. “Hurray! I’m helphull!” :wink: