I Keep Searching, and I can't find what I am looking for...

I Keep Searching, and I can’t find what I am looking for… I did several searches, and while a lot of them had results that were almost what I was asking, they were not quite right…

I just want to set a previously invisible window to visible, when a button is clicked. This is EXTREMELY basic, and easy, but nothing had quite the answer I was looking for… can anyone help me with this? It’ll take like 2 seconds… literally…
something like:

on buttonClicked_(sender)
set the visible of window “mainWindow” to false
set the visible of window “secondWindow” to true
end buttonClicked_

but that is not real code…

You have to remember that this is not AppleScript Studio. AppleScriptObjC is accessing Objective-C.

The window has methods “makeKeyAndOrderFront:” and “orderOut:”
Look in the documentation under NSWindow to see the methods available to it.


mainWindow's orderOut_(sender)
secondWindow's makeKeyAndOrderFront_(sender)