Opening a second window?

How do you open up a second window you might have stored in Interface Builder from within Xcode? Meaning, if I had a window with separate options in it, how do I open it from an AppleScript?

Sorry if my question doesn’t make sense, I’m not completely sure of the terminology quite yet. :slight_smile:

~ Tom

Hi SirThom,

After giving you that little help earlier about setting the default content of your textfield, I saw your other post down below.

Yes, it looks like you do need to read more AS Studio books (or Apple’s Documentation on writing AS Studio applications that you can activate from within XCode). You definitely can’t proceed with building your apps without poring through the documentations.

Anyway, just to start you up on your present question “opening a second window” that you built up in IB, here’s some pointer. I am assuming that your window is invisible when the nib wakes up (set as invisible in the IB), that’s why you want to activate that invisible second window.

To do that, one way you could do is have a clickable button (say it’s name is “myButton”) that you can click from the active window, for instance window “main”. Then in the “on clicked theObject” handler, tell your script to activate the second window (let’s say the second window has the AppleScript name - not Attribute name - “secondWindow”) like this:

on clicked theObject
if the name of theObject as Unicode text is "myButton" then
set visible of window "secondWindow" to true
end if
end on clicked

I am assuming here too that you know how to connect the clickable button to the AppleScript codes (Command-8 in IB).

I do hope this gets you going - not only on your current project, but also on reading more AS Studio references. Everyone gets their hands wet at some point in time.

Good luck.

archseed :slight_smile: