I appreciate that there are already questions on this topic, but having read the ones I can find (particularly this one: Tell AppleScript To Build XCode Project), they all seem to be a couple of years old and the answers do not seem to apply to the current version of Xcode.

Similarly to the linked question, I am attempting to automate opening an Xcode project, building it and then running the app in the iPhone Simulator (v4.3). The project in question is the Selenium project's iPhoneDriver (see here for details: http://code.google.com/p/selenium/wiki/IPhoneDriver)

Based on the answer in the other question, I have written the following script:

tell application "Xcode"
    open "/Users/<username>/Documents/Code/Selenium/iphone/iWebDriver.xcodeproj"
    tell project "iWebDriver"
         clean
         build
         try
             debug
         end try
    end tell
end tell

Unfortunately, when I run this I get the following:

tell application "Xcode"
open "/Users/ben.adderson/Documents/Code/Selenium/iphone/iWebDriver.xcodeproj"
    --> project document "iWebDriver.xcodeproj"
clean project "iWebDriver"
    --> missing value
build project "iWebDriver"
    --> missing value
debug project "iWebDriver"
    --> error number -1708
end tell

If I run just the open command, Xcode opens the project without issue. But as soon as I include the rest of the script the Xcode icon in the dock bounces, but that's all I get, apart from the above from the AppleScript Editor.

Can anybody advise what I'm doing wrong? This is the first time I've used AppleScript or Xcode, so I'm struggling to diagnose the problem.

I've tried looking at the Xcode AppleScript Dictionary, but without wo

Edit
Report