• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Applecripting Xcode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applecripting Xcode


  • Subject: Re: Applecripting Xcode
  • From: DeNigris Sean <email@hidden>
  • Date: Wed, 11 Nov 2009 00:10:05 -0500

On Nov 9, 2009, at 5:51 PM, DeNigris Sean wrote:

Hi list,

1.  Is there a way to create a new project via Applescript?  The last answer I could find was from years ago.
I ended up using UI Scripting for now.  Feel free to use it...
to make_new_project(project_name)
tell application "Xcode" to activate
tell application "System Events"
tell process "Xcode"
click menu item "New Project…" of menu 1 of menu bar item "File" of menu bar 1


tell window "New Project"
-- row 8 is empty project, 4 is Cocoa App
select row 4 of outline 1 of scroll area 1 of splitter group 1 of group 1
click button "Cocoa Application" of radio group 1 of scroll area 1 of splitter group 1 of splitter group 1 of group 1
click button "Choose…" of group 2


tell sheet 1
key code 5 using {command down, shift down} -- g key


tell sheet 1
set value of text field 1 to "[path/to/project/]"
click button "Go"
end tell


set value of text field 1 to project_name


click button "Save"
end tell
end tell
end tell
end tell
end make_new_project

2.  Does anyone know of a good reference/tutorial one Xcode's applescript-ability?
I'm still looking for one, but I learned a lot creating my script, so I created an Xcode handler library.  It's long, so here are the links to the code on my blog: 
Xcode library script
script that uses the library handlers to set up a new C++ project in Xcode for BDD testing
Blog entry explaining the motivation

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Applecripting Xcode (From: DeNigris Sean <email@hidden>)

  • Prev by Date: Re: Screen Saver ON/OFF!
  • Next by Date: Entourage 2008 categories of each note into note's body
  • Previous by thread: Applecripting Xcode
  • Next by thread: printing PDF files
  • Index(es):
    • Date
    • Thread