I’m relatively new to Xcode and Interface Builder. I’ve successfully created a couple of small Applescript applications, but now I’m running into a problem. It seems like I’m missing something really basic and I can’t believe I’m the first, but a search of the forums hasn’t turned up anything for me. When I do this on my machine at home, it works the way I expect. When I do it at work, I get a problem. Here is the simplest way to reproduce it.
In Xcode, I select “New Project” and specify “Applescript Application.” I’ll call this project “DemoProject.” An appropriately named project directory is created for me in my home directory.
Looking at the DemoProject window that opens in Xcode, I can expand the Scripts folder to see my default DemoProject.applescript file.
I double-click “Main Menu.nib” to open it in Interface Builder.
I drag a button from the “Cocoa-Controls” palette on to the default window. In this case it’s a button of type “Push Button,” but this problem doesn’t depend on which widget I select.
I select the button and hit shift-command-i to open the “NSButton Info” window.
I select Applescript from the pull-down menu in the “NSButton Info” window.
I click the check box next to Action: Clicked in the “Event Handlers” area.
Here’s the problem. There’s nothing in the “Script” area at the bottom of the window. At home, I can see the DemoProject.applescript file, and even open it and edit it by clicking the “Edit Script” button. At work, there are no scripts available, and even using the “New Script” button to create a new script doesn’t result in any scripts being listed in this area, though I can browse to the new file in the Finder.
Any ideas?
Thanks,
Jeff
Model: Home: G5 iMac; Work: dual 2 Ghz PowerPC G5
AppleScript: I’m running Xcode 1.5 and IB 2.4.2.
Browser: Firefox 1.5.0.1
Operating System: Mac OS X (10.3.9)
Here’s what else I’ve tried. I’ve uninstalled XcodeTools and reinstalled it from the disk image I downloaded from the Developer Connection. No dice.
I also tried opening a project that originated on my home system on the work machine, and I encountered the same problem. Scripts that were previously available to me in that window are no longer visible in the Scripts pane.
One observation about looking at my home project at work: If I select a control to which I had already assigned an event handler and linked to a script, the “Edit Script” button is clickable. It doesn’t actually do anything, but the button is active. If I select something on the window that isn’t already assigned an event handler, the “Edit Script” button is grayed out and inert. I don’t know what to conclude from this, but it’s mildly interesting.
I tried uninstalling the whole thing and installing Xcode version 1.2, which Apple’s site claims is compatible with 10.3.x. Now when I create an Applescript project it will create the project files in my home directory, but it won’t display the project within the Xcode application. That is to say, Xcode is running, but there are no windows open, and no other acknowledgement that there is a project open.
If in this situation I try to create another new project, I get this:
Like I said man, I feel your pain. I’ve been developing an application for work over the last 6 months. This issue has required me to bring my laptop to work every day, write the code and build the app on my laptop, then transfer it to my work machine. If it turns out there’s a bug somewhere, I have to go back to my laptop to trouble shoot it, then transfer it back to my work machine ad infinitum. Not only is this technically against company policy, It’s a pain in the butt to have to work this way.
The strange thing is, I’m able to create Cocoa applications using Objective-C, but for some reason, it just doesn’t like AppleScript Studio.
I’m not entirely sure I understand exactly what your problem is, but if you’re talking about being able to view the script in the detail view, you need to click the “editor” button at the top of the project window. Also if you go into the preferences menu from the Xcode menu you can check the box under “General” to have an item automatically open in the detail view.
If this is not what you’re looking for, I apologize for misunderstanding the problem.