For the 3rd time now, the system adminstrator has installed Xcode 1.5 on my machine at work,
(we’re still running Panther). When I lauch Interface Builder and select the AppleScript pane in the info panel,
there is no script in which to associate my interface elements.
When I select “New Script”, a new script is created in the project folder but nothing appears in the
script section of the AppleScript pane. Is this normal for Xcode 1.5 or would this suggest an error in the installation.
Thanks very much.
For Interface Builder to recognize an applescript in a project, you must open the nib within the context of an active xcode project (i.e. from xcode). Interface builder doesn’t keep track of connections you make with code in your project… only Xcode does this. If you simply open your nib file in IB (without going through Xcode) it has no knowledge of where to find your applescript files or what connections have been made with your code… it simply ignores them until it is opened from xcode.
To be able to make connections to your script, you must launch the nib file from Xcode. Xcode will create the necessary bridge between xcode and IB, giving it all of the info it needs to recognize your connections and allow it to see the scripts in your project. Also, if you close your xcode project while working on your nib file you’ll find that your ability to link to your scripts is lost. There’s no way to get around this other than closing the nib file, going back into your project, and reopening the nib from xcode. Try to keep good track of your nib files in this respect, because working on files outside of the context of your project could potentially be a source of corruption. I ALWAYS save my IB work while my project is still open, and always immediately close my nib after closing a project. That way, if I do need to go back and make UI changes, I can just open the nib again from xcode, knowing that nothing has been changed since I worked on it last from within the project, greatly reducing the possibility of having a corruption. Once a nib is corrupted, you can pretty much bank on the whole interface being trash, possibly even the whole project.
Hope that helps (and doesn’t freak you out too much :D)…