Help with xCode and AppleScript

Hi,

I need some help with AppleScript.

I have a few source files and would like to use AppleScript to create a new xCode project, define new target, add files and build everything.

tell application “Xcode”
make new project with properties {name:“Test”, path:“/Users/vlad/test”}
end tell

The lines above doesn’t work. I’m relatively new to AppleScript.
Doing everything manually or using makefiles is not an option. It has to be AppleScript.

Any advise or links will be greatly appreciated.

Thank you,
Vlad

The first problem is that you don’t specify the ‘at’ parameter, which shouldn’t really be required, but is. Should be:

make project at end with properties {name:“Test”, path:“/Users/vlad/test”}

The next problem is that that doesn’t do anything useful in any case. In fact, I think it’s buggy. You might try specifying more properties if you have more information about he projects you want to create, like build style and build target and what-have-you.

I Hope it’s OK to jump on this carriage —

I’m trying to do something like this myself, but on a little bit larger scale.

I need to

  1. Create a new XCode project using one of my own created&installed project templates
  2. Further modify the project created (adding more files, removing some, renaming and configuring targets and executables, connecting to source-control, etc.).

So, my first question is:

Can you specify a template to the “make new project at end” ?

My second question, (supposedly this is not possible) How can I script XCode through it’s menus to create a project using a template?

I have succeeded in opening the new project dialog with


tell application "Xcode"
	activate
end tell
tell application "System Events"
	keystroke "N" using command down & shift down
end tell

although its terribly ugly. But how do I go further? How do I navigate through the UI ? tabs? checkboxes? buttons?

Any hint will be appreciated!