{"id":1886,"date":"2009-03-16T12:22:50","date_gmt":"2009-03-16T16:22:50","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=1886"},"modified":"2016-07-07T09:47:49","modified_gmt":"2016-07-07T13:47:49","slug":"opening-header-files-via-launchbar","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2009\/03\/16\/opening-header-files-via-launchbar\/","title":{"rendered":"Opening Header Files via LaunchBar"},"content":{"rendered":"<p>I&rsquo;ve long used <a href=\"http:\/\/www.obdev.at\/products\/launchbar\/\">LaunchBar<\/a> to quickly open Mac OS X header files. The built-in &ldquo;Development Resources&rdquo; indexing rule can be configured to scan headers. However, this has two problems:<\/p>\r\n<ol>\r\n<li>The headers are commingled with the HTML reference files. I do want access to the reference files, but sometimes I know I want to open the header.<\/li>\r\n<li>It opens headers from the 10.4u SDK even though I&rsquo;m running Leopard.<\/li>\r\n<\/ol>\r\n<p>Here&rsquo;s a LaunchBar AppleScript that will <em>only<\/em> open headers, and it will open <em>all<\/em> the matching headers:<\/p>\r\n<pre>on handle_string(_string)\r\n    do shell script \"echo '1' | open -h \" &amp; _string's quoted form\r\nend handle_string\r\n<\/pre>\r\n<p>The &ldquo;1&rdquo; is because if there are multiple matches, <tt>open<\/tt> will ask you what it should do:<\/p>\r\n<pre>open -h NSAttr\r\nNSAttr?\r\n[0] cancel\r\n[1] all\r\n[2] \/System\/Library\/Frameworks\/AppKit.framework\/Headers\/NSAttributedString.h\r\n[3] \/System\/Library\/Frameworks\/CoreData.framework\/Headers\/NSAttributeDescription.h\r\n[4] \/System\/Library\/Frameworks\/Foundation.framework\/Headers\/NSAttributedString.h\r\n<\/pre>\r\n<p>And I want to pick &ldquo;all.&rdquo;<\/p>","protected":false},"excerpt":{"rendered":"<p>I&rsquo;ve long used LaunchBar to quickly open Mac OS X header files. The built-in &ldquo;Development Resources&rdquo; indexing rule can be configured to scan headers. However, this has two problems: The headers are commingled with the HTML reference files. I do want access to the reference files, but sometimes I know I want to open the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1886","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=1886"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1886\/revisions"}],"predecessor-version":[{"id":15105,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1886\/revisions\/15105"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=1886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=1886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=1886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}