{"id":38,"date":"2005-10-14T08:03:38","date_gmt":"2005-10-14T15:03:38","guid":{"rendered":"http:\/\/www.red-sweater.com\/blog\/?p=38"},"modified":"2005-10-14T08:03:42","modified_gmt":"2005-10-14T15:03:42","slug":"stealing-seconds-back-from-xcode","status":"publish","type":"post","link":"https:\/\/redsweater.com\/blog\/38\/stealing-seconds-back-from-xcode","title":{"rendered":"Stealing Seconds Back from Xcode"},"content":{"rendered":"<p>A lot of people like to complain about how Xcode is, in some ways, too slow. Especially when it comes to compilation time, developers who were familiar with CodeWarrior&#8217;s relatively blazing speed are often disappointed at the non-stellar performance of gcc in Xcode.<\/p>\n<p>\nWhile we wait patiently for Xcode&#8217;s performance to improve, it&#8217;s important to make sure that we don&#8217;t waste any more time or frustration in the program than we need to. To that end, I am always looking for ways to automate those &#8220;repeat them all the time&#8221; actions I am liable to take in Xcode.\n<\/p>\n<p>\nOne of the tedious tasks I often find myself can be summarize in three easy words: &#8220;Reveal Active Product.&#8221; Unfortunately, the process is slightly less straightforward in all but the simplest of projects. One must first navigate through the Files &#038; Groups tree to find the &#8220;Products&#8221; group. This group may or may not need to be disclosed to reveal its contents. Then the brain must be asked to do extremely menial work for a few moments as it decides which of the multiple products generated by this project is actually the one you&#8217;re interested in now. When these brain cells finally die, you&#8217;re left with a mouse right-clicking the item of interest, to locate and select the &#8220;reveal in Finder&#8221; item.\n<\/p>\n<p>\nThat&#8217;s too much work for me! I do this all the time. I need a keyboard shortcut. So, compliments of FastScripts and the following AppleScript, I am from this day forward using &#8220;Ctrl-Cmd-R&#8221; as a shortcut in Xcode for &#8220;Reveal Active Product.&#8221;<\/p>\n<div style=\"margin-left:1cm\">\n<pre>\n-- Get the active target's product as a posix path\ntell application &quot;Xcode&quot;\n\tset myTarget to active target of active project document\n\tset myFile to product reference of myTarget\n\tset myPath to full path of myFile\nend tell\n\n-- Convert to an alias and ask Finder to reveal\nset myAlias to POSIX file myPath\ntell application &quot;Finder&quot;\n\tif exists myAlias then\n\t\tactivate\n\t\treveal myAlias\n\telse\n\t\tbeep\n\tend if\nend tell\n<\/pre>\n<\/div>\n<p>\nIf the active target&#8217;s product exists, the Finder will reveal it. If there is no such file, you get a beep. Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A lot of people like to complain about how Xcode is, in some ways, too slow. Especially when it comes to compilation time, developers who were familiar with CodeWarrior&#8217;s relatively blazing speed are often disappointed at the non-stellar performance of gcc in Xcode. While we wait patiently for Xcode&#8217;s performance to improve, it&#8217;s important to [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-38","post","type-post","status-publish","format-standard","hentry","category-xcode"],"_links":{"self":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/38","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/comments?post=38"}],"version-history":[{"count":0,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/38\/revisions"}],"wp:attachment":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/media?parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/categories?post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/tags?post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}