<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Osa on galvanist</title>
    <link>/tags/osa/</link>
    <description>Recent content in Osa on galvanist</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sat, 28 Mar 2020 18:28:48 +0100</lastBuildDate>
    <atom:link href="/tags/osa/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>macOS JavaScript for Automation (JXA) Notes</title>
      <link>/posts/2020-03-28-jxa_notes/</link>
      <pubDate>Sat, 28 Mar 2020 18:28:48 +0100</pubDate>
      <guid>/posts/2020-03-28-jxa_notes/</guid>
      <description>&lt;h1 id=&#34;overview&#34;&gt;Overview&lt;/h1&gt;&#xA;&lt;p&gt;There is a macOS feature called the &lt;a href=&#34;https://en.wikipedia.org/wiki/AppleScript#Open_Scripting_Architecture&#34;&gt;Open Scripting Architecture&lt;/a&gt; (OSA) which provides an infrastructure for intercommunication and automation of macOS software. One of the officially supported OSA languages is JavaScript and its use in this context is called &amp;ldquo;JavaScript for Automation&amp;rdquo; which is often abbreviated to &amp;ldquo;&lt;strong&gt;JXA&lt;/strong&gt;&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;The idea is that instead of using &lt;a href=&#34;https://en.wikipedia.org/wiki/AppleScript&#34;&gt;AppleScript&lt;/a&gt;, you can program &amp;amp; automate macOS using a more modern language like &lt;a href=&#34;https://en.wikipedia.org/wiki/JavaScript&#34;&gt;JavaScript&lt;/a&gt;. This gives the programmer access to the enormous ecosystem of javascript libraries and tools in addition to all the modern optimizations and language features of ES6-ish JavaScript. JXA also provides access to a built-in Objective-C bridge that enables access to the file system and the ability to call into the Cocoa frameworks and plain C functions. JXA can basically do anything native code can. It&amp;rsquo;s a bit like &lt;a href=&#34;https://en.wikipedia.org/wiki/Node.js&#34;&gt;node&lt;/a&gt; without needing to install node.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
