<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:ent="http://www.purl.org/NET/ENT/1.0/" version="2.0">
  <channel>
    <title>Curiouser and Curiouser! on applescript</title>
    <link>http://matt.blogs.it/</link>
    <description>RSS feed for topic applescript</description>
    <copyright>Copyright 2008 Matt Mower. Some rights reserved.</copyright>
    <generator>Squib/0.5.0.382</generator>
    <managingEditor>self@mattmower.com</managingEditor>
    <webMaster>self@mattmower.com</webMaster>
    <language>en-gb</language>
    <item>
      <title>Can't we all just get along?</title>
      <link>http://matt.blogs.it/entries/00002928.html</link>
      <pubDate>Wed, 15 Oct 2008 11:17:45 +0100</pubDate>
      <description>&lt;p&gt;Like a lot of folks these days I write all my Objective-C code, like I write my Ruby code, using TextMate instead of Xcode. Xcode has more tricks these days but they don't much up for it's deficiencies and, well, there is an argument for having one editor and knowing it well.&lt;/p&gt;

&lt;p&gt;However I still use Xcode to manage my project files &amp;amp; dependencies and to build &amp;amp; run my code (even if I am starting to use command-line gdb because it seems more reliable that way). I find the Xcode build results easier to use than the built-in TextMate approach and Xcode knows how to manage Cocoa projects and their dependencies.&lt;/p&gt;

&lt;p&gt;Up until now I've been writing in TextMate then switching to Xcode and hitting Cmd+B, Cmd+R, or Cmd+Y depending on whether I want to build, run, or debug. But it irked me because I would keep using Cmd+B in TextMate. To begin with this would trigger TextMate's use of &lt;code&gt;xcodebuild&lt;/code&gt; which annoyed me and I quickly disabled that.&lt;/p&gt;

&lt;p&gt;This morning in one of those facepalm moments it occurred to me to ask why I hadn't checked if Xcode was Applescriptable. Of course, it is.&lt;/p&gt;

&lt;p&gt;So one script (saved as &lt;code&gt;~/Applications/BuildWithXcode.scpt&lt;/code&gt;) later:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;tell application "Xcode"
    activate
    build
end tell
tell application "TextMate"
    activate
end tell
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and I have Cmd+B bound to &lt;code&gt;oscript ~/Applications/BuildWithXcode.scrpt&lt;/code&gt; and I'm away. Similar for run and debug:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;tell application "Xcode"
    activate
    run
end tell
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;TextMate and Xcode working together nicely.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002928.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
  </channel>
</rss>
