{"id":11293,"date":"2015-05-22T10:06:59","date_gmt":"2015-05-22T14:06:59","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=11293"},"modified":"2015-05-22T10:08:39","modified_gmt":"2015-05-22T14:08:39","slug":"launchbar-action-editor-and-applescript-list-syntax","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/05\/22\/launchbar-action-editor-and-applescript-list-syntax\/","title":{"rendered":"LaunchBar Action Editor and AppleScript List Syntax"},"content":{"rendered":"<p><a href=\"https:\/\/www.obdev.at\/products\/launchbar\/releasenotes.html\">LaunchBar 6.4<\/a> introduces a new action editor:<\/p>\n<blockquote cite=\"https:\/\/www.obdev.at\/products\/launchbar\/releasenotes.html\">\n<ul>\n<li>Easily create new actions from scratch or duplicate existing actions for customization.<\/li>\n<li>Configure action properties, runtime behavior, and more. Values are pre-filled where possible.<\/li>\n<li>Configure and modify action scripts with various scripting languages.\n<ul>\n    <li>Script templates provided for AppleScript, JavaScript, Python, Ruby, Shell script and Swift.<\/li>\n    <li>Easily add or remove Suggestions Scripts and Action URL scripts.<\/li>\n    <li>Configure script properties.<\/li>\n    <li>Open scripts in default editor for editing.<\/li>\n<\/ul><\/li>\n<li>Manage action resources\n<ul>\n    <li>Add, rename or delete resources.<\/li>\n    <li>Set image as action icon.<\/li>\n<\/ul><\/li>\n<li>Manage localization\n<ul>\n    <li>Add or remove localizations.<\/li>\n    <li>Manage localizable strings.<\/li>\n<\/ul><\/li>\n<\/ul>\n<\/blockquote>\n<p>There is actually quite extensive <a href=\"https:\/\/developer.obdev.at\/resources\/documentation\/launchbar-developer-documentation\/#\/welcome\">support and documentation<\/a> for custom actions now, with more emphasis on sharing actions (and therefore <a href=\"https:\/\/developer.obdev.at\/resources\/documentation\/launchbar-developer-documentation\/#\/code-signing\">code signing<\/a> to make that secure). It&rsquo;s also instructive to look at the built-in actions to see how they work.<\/p>\n<p>I learned, for example, that at some point AppleScript added support for using square brackets for list literals. I do not see this <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/AppleScript\/Conceptual\/AppleScriptLangGuide\/conceptual\/ASLR_lexical_conventions.html#\/\/apple_ref\/doc\/uid\/TP40000983-CH214-SW10\">documented<\/a> <a href=\"https:\/\/developer.apple.com\/library\/mac\/releasenotes\/AppleScript\/RN-AppleScript\/Introduction\/Introduction.html#\/\/apple_ref\/doc\/uid\/TP40000982-CH1-SW1\">anywhere<\/a>, so I&rsquo;m not sure how far back scripts with this syntax will work. But it&rsquo;s nice when you have a mix of lists and records to be able to write:<\/p>\n<pre>[{k1:\"v1\", k2:[1, 2, 3]}, {k1:\"v2\", k2:[4, 5, 6]}]<\/pre>\n<p>instead of using curly brackets for everything:<\/p>\n<pre>{{k1:\"v1\", k2:{1, 2, 3}}, {k1:\"v2\", k2:{4, 5, 6}}}<\/pre>\n<p>Note that you <em>cannot<\/em> use square brackets and colons for record literals. Except in Swift, where you have to use square brackets for everything.<\/p>","protected":false},"excerpt":{"rendered":"<p>LaunchBar 6.4 introduces a new action editor: Easily create new actions from scratch or duplicate existing actions for customization. Configure action properties, runtime behavior, and more. Values are pre-filled where possible. Configure and modify action scripts with various scripting languages. Script templates provided for AppleScript, JavaScript, Python, Ruby, Shell script and Swift. Easily add or [&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":[159,466,46,467,30,32,71,48,901],"class_list":["post-11293","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-applescript","tag-codesigning","tag-languagedesign","tag-launchbar","tag-mac","tag-macapp","tag-programming","tag-security","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11293","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=11293"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11293\/revisions"}],"predecessor-version":[{"id":11295,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11293\/revisions\/11295"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=11293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=11293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=11293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}