Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Can I Automate Tasks in Xcode?

Tags:

xcode

macros

I'm building an app in Obj-C / Xcode and I'm running into some repetitive tasks. For example if I want to add an image resource to my project I just go through the same identical steps... only difference is the path to the resource.

How can I automate these tasks?

Is there some sort of Xcode macro-recorder like in Photoshop and Excel?

like image 664
MrDatabase Avatar asked May 20 '09 02:05

MrDatabase


1 Answers

There's definitely no macro recorder, but there are some tools you can use. First, there's Applescript, which is the most likely to be of use for this particular problem. I'm not promising it'll be easy, however. There isn't a rich collection of Applescripts for Xcode that I know of, so you'd need to dig through the Scripting Suite using Script Editor and see what's available.

For text things, there are User Scripts, which you can create from the script menu (it looks like a scroll). You can write perl, python, ruby, or whatever you like to process selected text and turn it into other text.

You can also create text macros (Edit>Insert Text Macro).

Another major repetitive task is setting up your initial project. For that you can create new project templates to be set up as you like them. I have most of a walkthrough of that written up, and should have something posted on Cocoaphony this week or early next as part of my Building the Build System series.

like image 93
Rob Napier Avatar answered Oct 31 '22 16:10

Rob Napier