<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hiroki Tani on Medium]]></title>
        <description><![CDATA[Stories by Hiroki Tani on Medium]]></description>
        <link>https://medium.com/@hiloki?source=rss-917ac73ebf8f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0agzRy54aXU8VhyNoDO_Sg.jpeg</url>
            <title>Stories by Hiroki Tani on Medium</title>
            <link>https://medium.com/@hiloki?source=rss-917ac73ebf8f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 15:50:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hiloki/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Config 2022: Figma Hacks and Workflow Enhancements with Plugins]]></title>
            <link>https://medium.com/@hiloki/config-2022-figma-hacks-and-workflow-enhancements-with-plugins-14853a36ce89?source=rss-917ac73ebf8f------2</link>
            <guid isPermaLink="false">https://medium.com/p/14853a36ce89</guid>
            <category><![CDATA[figma]]></category>
            <category><![CDATA[figma-plugin]]></category>
            <category><![CDATA[config-2022]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[designer]]></category>
            <dc:creator><![CDATA[Hiroki Tani]]></dc:creator>
            <pubDate>Sat, 28 May 2022 12:15:41 GMT</pubDate>
            <atom:updated>2022-05-30T17:05:58.361Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q6e15LN9yYfgihnMBdv79A.png" /></figure><p>This article is a reworked version of a session from Figma’s “Config 2022” conference held on May 11, 2022.</p><p>My session was in Japanese, so I reworked this article in English.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FW1uwT-CUmUA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DW1uwT-CUmUA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FW1uwT-CUmUA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb09d5d3e26249ac94284eb0ebdb7b59/href">https://medium.com/media/fb09d5d3e26249ac94284eb0ebdb7b59/href</a></iframe><p>My name is Hiroki Tani(<a href="http://twitter.com/hiloki">@hiloki</a>), and I am a design engineer at <a href="https://ubiehealth.com/">Ubie, inc</a>., a health tech startup.<br>In this article, I would like to talk about how I would like to make design work a little easier and how I would like to create my own Figma plugin for that purpose.</p><h3>Figma Features</h3><p>Figma has many powerful features such as <strong>Auto Layout</strong>, <strong>Variants</strong> for components, and <strong>Team Library</strong> for teams to share components and styles.<br>What I like about Figma besides these features is the community feature called <strong>Figma Community </strong>and the many <strong>Figma Plugins</strong> that are published there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*gWPROqSDt0Q-oxjO" /></figure><p><a href="https://www.figma.com/community/plugin/738454987945972471/Unsplash">Unsplash</a> loads photos directly from unsplash.com onto Figma. <a href="https://www.figma.com/community/plugin/732603254453395948">Stark</a> is an accessibility plugin that checks the contrast ratio of color combinations.<a href="https://www.figma.com/community/plugin/843461159747178978/Figma-Tokens">Figma Tokens</a>, which manages Design Tokens, are also popular. Some of the more comical plug-ins, such as <a href="https://www.figma.com/community/plugin/953318991680776075/Nicolas-Cage-Image-Replacer">Nicolas Cage Image Replacer</a>, are also interesting.</p><h3>Too many plugins!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*dSncFJZNYhBd2U4A" /></figure><p>There are so many plugins that it is hard to find the “plugin I want” among them. Even if you find one that looks like it, you often don’t understand the description or that it is not what you expected when you installed it. What should you do in such cases?</p><blockquote>If you don’t have it, make it.<br>If you need money, invent it.<br> — Eiji Tsuburaya</blockquote><p>These words are from Eiji Tsuburaya, who was involved in historical special effects films such as “Godzilla”. I like this phrase very much, and it is my motto, and I like the challenge of “creating something that doesn’t exist.</p><p>So I started making my plugins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*3cQXJ94KO5XEBhcW" /></figure><p>The plug-ins I have created are available on <a href="https://www.figma.com/@hiloki">my Figma Community profile</a>.<br>Today I would like to introduce two of them.</p><h3>Introduction of my plugins</h3><h4>Contrast Grid</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*YyuLiJBGXF2O-tFG" /></figure><p><a href="https://www.figma.com/community/plugin/993414361395505148/Contrast-Grid">Contrast Grid</a> is a plugin that displays the contrast ratio of a color combination (background and text colors) in a grid and lists whether the ratio is 4.5:1 or greater, according to <a href="https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html">WCAG 2.1</a>. I created this plugin because I needed it when designing a color palette as a design system.</p><p>Contrast Grid was initially a <a href="https://contrast-grid.eightshapes.com/">web-based tool created by EightShapes</a>, but it was challenging to switch back and forth between the web-based tool and Figma. So, I decided to make it possible to use Figma to complete the process. This plugin also allows the user to check the contrast ratio considering opacity.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Flv7WL5xmT8Y%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dlv7WL5xmT8Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Flv7WL5xmT8Y%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/16cc74fda1f399aa51e329160cf7f708/href">https://medium.com/media/16cc74fda1f399aa51e329160cf7f708/href</a></iframe><h4>Typography Styleguide</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*zuvudejPOu-TFa61" /></figure><p><a href="https://www.figma.com/community/plugin/965313760136371738/Typography-Styleguide">Typography Styleguide</a> is a plugin that generates a catalog of Text Styles as a file’s Local Style. So, I created a plugin that automatically generates these styles.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FI50wtNcWZ8o%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DI50wtNcWZ8o&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FI50wtNcWZ8o%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a3b319e78309ddd6dda7bd11e553144/href">https://medium.com/media/1a3b319e78309ddd6dda7bd11e553144/href</a></iframe><h3>Plugins are powered by web technologies</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*FSKd3buFY7RsGW6V" /></figure><p>Figma plugins are not made with any new or specialized technology but with web technologies such as HTML, CSS, and JavaScript.<br>So, for my part, I believe that even if you are not an engineer with programming skills or a designer with little coding experience, you can take on the challenge.</p><h3>Figma Plugins API</h3><p>To understand how to manipulate Figma with web technologies, you need to know about <a href="https://www.figma.com/plugin-docs/intro/">the Plugins API</a>, which allows you to read and manipulate values as they appear in the Layers and Properties panels of Figma.</p><p>If you are new to code development, you may not even know what an API is. However, Figma’s Plugins API does what you would do if you manipulated Figma’s UI by hand.</p><p>Here is a small sample code.</p><pre>figma.currentPage.selection[0].name = &quot;Sign up&quot;</pre><p>This code is a sample of JavaScript manipulation of the Figma Plugins API. I will break this down one by one to explain how it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*v0J2SUMjEYvoG2y0" /><figcaption>Left: `figma` part of the code. Right: the whole in Figma’s UI.</figcaption></figure><p>The first figma is called “Global object” as an API. But you can understand it as “within the whole of Figma” or so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*UwaQWRodwvbQFdDx" /><figcaption>Left: `currentPage` part of the code. Right: “current page” in Figma’s UI.</figcaption></figure><p>The currentPage is, as the term implies, the “current page”. You can access anything on the current page by imagining the UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*J5y3ywrOTamjpQa5" /><figcaption>Left: `selection[0]` part of the code. Right: “one of the layers in the selection” in Figma’s UI.</figcaption></figure><p>The selection is also “the layer currently selected”. In other words, it means “the currently selected layer in Figma, in the current page”.<br>The [0] is a JavaScript “Array”, and the number inside is an index. Don’t overthink it now; think of it as code that explicitly means “first” in the program.<br><em>It is </em><em>0 when the “first” is just a convention in computer calculations!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*yBvpBP0DewB0tMIa" /><figcaption>Left: `name` part of the code. Right: “layer name” in Figma’s UI.</figcaption></figure><p>The name is “the name of the layer”. In other words, it means “in Figma, in the current page, in the selected layer, the name”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Dxw2-xRMAXv7nB3F" /><figcaption>Left: `= “Sign up”` part of the code. Right: the name of the layer is rewritten to “Sign up” in Figma’s UI.</figcaption></figure><p>The last one is = “Sign up”. ”Sign up” is the string “Sign up”, and = is a substitution, where the before equal replaces the after equal. So, the code is “replace the selected layer, name, in Figma, in the current page, with the string “Sign up”.</p><p>In this way, you can see that the Figma Plugins API and JavaScript are not meaningless strings but rather a kind of UI operation that is replaced by code.</p><p>You can read the Plugins API Reference for more rudimentary information and sample code explanations. In addition, you can follow <a href="https://www.figma.com/plugin-docs/api/api-reference/">the API Reference</a> to see what you can reference values.</p><h3>The process of building and publishing plugins</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*R6xjO8cbAbTPhML_" /></figure><p>You know how to work with the API; let’s look at the process of publishing a plugin.</p><p>There are several ways to start plugin development, but the basic approach is to use an official template. You can select a template from the menu Plugins &gt; Manage Plugins… in Figma’s Desktop App.</p><p>After you have used them and written the code, you will need to apply. Before the plugin is released, it will be reviewed, and the results will be returned in 3 days at the earliest or 2 weeks at the latest. If the review result is satisfactory, the plugin will be released.</p><h3>Need to set up a development environment.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*vzHPsX2DnPk6Yy2B" /></figure><p>I have briefly explained the process from plugin development to publication, but you will need to set up the environment for it in development. At the very least, you will need an environment such as Node.js, and if you work in a job where you do not usually write code, you may stumble here.</p><p>For my part, I wanted to let people know “what they can do” with APIs and scripts before they stumble upon such a development environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*yf9GgMUzbJJfFdo0" /></figure><p>This session will not talk about Figma plugins but about automation using <strong>DevTools</strong> and script management using the <strong>Scripter</strong> plugin.</p><p>Therefore, as the theme of this session, we will talk about <strong>hacking Figma with JavaScript</strong> rather than hacking Figma with plugins.</p><h3>Figma’s DevTools</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*lP_wwdAIRupW_gQZ" /></figure><p><strong>DevTools</strong> is the “Developer Tools” and is the same as what is available in Google Chrome. From here, let’s try some things in the DevTools <strong>Console</strong>.</p><pre>figma.notify(&#39;Hello、こんにちわ&#39;)</pre><p>figma.notify() is an API that displays a notification message at the bottom of the screen. Passing a string to it will display the contents of the message. You can execute this code in the Console tab.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FGu9Ono0ivSU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DGu9Ono0ivSU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FGu9Ono0ivSU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/63e06918f7dcbbae53ea2701873f5389/href">https://medium.com/media/63e06918f7dcbbae53ea2701873f5389/href</a></iframe><p>When you run it, you get a notification message.</p><p>Let’s also try the script to change the layer name as explained earlier.</p><pre>figma.currentPage.selection[0].name = &quot;Sign up&quot;</pre><p>As explained, the “first layer in the selection” will be renamed, so run it in the Console with the layer selected.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FGeW6ifR2-yo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DGeW6ifR2-yo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FGeW6ifR2-yo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac8fcf9b643f9ea532125d3c991b94fc/href">https://medium.com/media/ac8fcf9b643f9ea532125d3c991b94fc/href</a></iframe><p>The name of the layer has been changed to “Sign up”.</p><h3>More Practical Examples</h3><p>The examples introduced so far are not very practical, so we will present a few more cases that are more likely to be used in actual situations.</p><h4>Renaming by naming conventions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*ymCsTXyrj3ibfdO6" /></figure><p>This script is an example of modifying a Frame name to conform to the naming conventions.</p><p>In this example, the naming conventions are “all lowercase”. And “no space before or after a one-byte slash, which is the delimiter of the hierarchy.</p><p>But uppercase letters are mixed in, and the spaces before and after the slash are with or without in this. Let’s try to correct this.</p><p><a href="https://gist.github.com/hiloki/a74939f2f29de69c24fd1e795c5edcfe">📜 <strong>Code</strong></a></p><pre>const selection = figma.currentPage.selection;</pre><pre>selection.forEach(node =&gt; {<br>  // Get current name<br>  const srcName = node.name;</pre><pre>// Split by slash e.g. Questionnaire, Age<br>  const splitName = srcName.split(&#39;/&#39;);</pre><pre>const newName = splitName.map(name =&gt; {<br>  // Remove start/end space, and to lowercase<br>    return name.trim().toLowerCase();<br>  })</pre><pre>// Assign new name<br>  node.name = newName.join(&#39;/&#39;)<br>})</pre><p>First of all, the node in the code is a “layer” in Figma’s API and internal implementation.</p><p>In the previous examples, I write as selection[0]. But we are processing “all layers in the selection” in this example.</p><p>For figma.currentPage.selection, JavaScript’s <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach">forEach()</a> iteration is used to format the name of each selected layer one by one.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnJLGLearsoY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnJLGLearsoY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnJLGLearsoY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/90902b6542e36d396587149a8a39a432/href">https://medium.com/media/90902b6542e36d396587149a8a39a432/href</a></iframe><h3>Find the Main component in the Frame</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*SGgOJn7jWzIDOi6P" /></figure><p>When designing a page, the Main component is sometimes mixed in with its Frame. I should manage the main component separately, and its instance should be in the screen design, but I often leave it while working on a page.</p><p>Here is a Script to find this Main component in the selected Frame.</p><p><a href="https://gist.github.com/hiloki/fd888d38137350a607ba09672f20c5e1">📜 <strong>Code</strong></a></p><pre>// Select any nodes<br>const selection = figma.currentPage.selection;</pre><pre>const components = selection.map(node =&gt; {<br>  if(&quot;children&quot; in node) {<br>    // Find “COMPONENT” type node <br>    const nodes = node.findAllWithCriteria({<br>      types: [&#39;COMPONENT&#39;]<br>    })<br>  <br>    return nodes;<br>  }<br>})</pre><pre>// Reselect Main Components<br>figma.currentPage.selection = components.flat();</pre><pre>// Show result at the notification<br>figma.notify(`Find ${components.flat().length} components 🕵️‍♂️`)</pre><p>As in the previous example of renaming a Frame, we iterate over “all selected layers”. This time we use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map"><strong>map()</strong></a> instead of forEach() to put the repeated result into a constant components, which is used in the latter part of the code.</p><p>In the content of the iteration process, we use findAllWithCriteria() in Figma’s API to find “layers of type Main component”. The COMPONENT type is the Main component, so we find it and put it in the components constant I mentioned earlier.</p><p>The figma.currentPage.selection appears again, which in the coding process is “Put the layer of the found main component in all selected layers”. In other words, it means “making the layer of the found Main components are selected”.</p><p>This process makes one or more Main components selected in the UI to see where the Main component’s location is.</p><p>As a bonus, I use figma.notify() to display the number of Main components found in a notification message.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FFNwI93wS0IU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DFNwI93wS0IU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FFNwI93wS0IU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a61527ea900c8836e9ffb2c83d60cf2c/href">https://medium.com/media/a61527ea900c8836e9ffb2c83d60cf2c/href</a></iframe><h3>Clone page for backup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*8wZOPFBHLaWgGgmM" /></figure><p>The third is to duplicate the current page (Page in Figma) with a script and add “current date and time” after the duplicated page name.</p><p>In this case, you can imagine that when you make a new design change to an existing page, you duplicate the page just in case.</p><p>If you keep the duplicate for a while as a backup, you want to leave the date and time of the duplicate so that it is easy to see when the page was duplicated.</p><p><a href="https://gist.github.com/hiloki/c1baa49e4d3f2020d03ec910df287329">📜 <strong>Code</strong></a></p><pre>const clonePage = figma.currentPage.clone();</pre><pre>// Get current date<br>const currentDate = new Date();</pre><pre>// Concat page name with current date<br>clonePage.name = `${clonePage.name} [${getCurrentTime(currentDate)}]`;</pre><pre>function getCurrentTime(currentDate) {<br>  const year = currentDate.getFullYear();<br>  const month = (currentDate.getMonth() + 1).toString().padStart(2, &#39;0&#39;);<br>  const date = currentDate.getDate().toString().padStart(2, &#39;0&#39;);<br>  const hours = currentDate.getHours().toString().padStart(2, &#39;0&#39;);<br>  const minutes = currentDate.getMinutes().toString().padStart(2, &#39;0&#39;);</pre><pre>return `${year}/${month}/${date} ${hours}:${minutes}`;<br>}</pre><p>Duplicating a Page by the script is clone() . In this code, clone() is done on figma.currentPage, which is the “current page”. The cloned page is then placed in clonePage.</p><p>The latter half of the code is JavaScript code unrelated to Figma’s API. Again, it does various complicated things, but I will skip the details this time with the code to get the current date and time.</p><p>In this sample, the current date and time are converted into a string. And put into the name of the clonePage by clonePage.name.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyjQQMeOOuYg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyjQQMeOOuYg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyjQQMeOOuYg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/57542fd645d90c0992765afbe61e9edb/href">https://medium.com/media/57542fd645d90c0992765afbe61e9edb/href</a></iframe><h3>Scripter plugin to manage JavaScript code</h3><p>So far, I have used the Console of DevTools to execute JavaScript code, but it isn’t easy to copy and paste it every time. So, I introduced a plugin called <strong>Scripter</strong>.</p><h4>Scripter</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*9joTERY98v0xS7Ox" /></figure><p><a href="https://www.figma.com/community/plugin/757836922707087381/Scripter">Scripter</a> is a unique plugin for Figma that allows you to run JavaScript and Figma APIs on it. The editor’s infrastructure is VS Code, with code highlighting and code completion.</p><p>Scripter allows you to name and save any code. If you want to reuse code like the one I have described, you can conveniently save it in Scripter.</p><p>Another helpful feature is sharing the code with other Figma users. For example, when running the Export button from the plugin’s UI, Scripter will create a button-like object on the Figma file. Users with other Scripter plug-ins can then select the generated button and click “<strong>Open Script</strong>” at the bottom right of Figma, and a user will import the code into their Scripter plugin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AxAyKp6uPs3BuFBiOs54dQ.png" /><figcaption>Left: generated Scripter button, Right: action button for relaunch plugin and import script</figcaption></figure><p>Please watch the demo. It tells you how to save the code in Scripter and how to action for sharing. This video shows the demo of “Find the Main component in Frame” code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmPqJLo9fQoc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmPqJLo9fQoc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmPqJLo9fQoc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/78e732edcb176af9683ac406622c4bfd/href">https://medium.com/media/78e732edcb176af9683ac406622c4bfd/href</a></iframe><h3>Create the color catalog</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*7ZIQgjBI4AGTW5Wm" /></figure><p>At last, here is one more extensive example. Like the Typography Styleguide plugin introduced in the first half, this code creates color styles (Color Styles) on the catalog registered in the file. In addition, it generates color tips, names, and HEX values aligned with the names, CSS Custom properties.</p><p>This code is somewhat more complex than the previous ones. Unfortunately, it is too large to reproduce in this article, but please look at <a href="https://gist.github.com/hiloki/b6045ed645bc9421a97efda010760f74">the sample code</a>.</p><p>It looks complicated, what it is doing is just automating in code what you would do manually in Figma’s UI: register the sample code in the Scripter plugin, try changing the values in it, add new functions, and so on.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F84wFhvgZjwU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D84wFhvgZjwU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F84wFhvgZjwU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5183ee4449d53a24c62e954d85f503f9/href">https://medium.com/media/5183ee4449d53a24c62e954d85f503f9/href</a></iframe><h3>Next: Try plugin development!</h3><p>If you are confident about hacking Figma using codes like the ones introduced here, please try your hand at plugin development.</p><p>For example, if you need a plug-in UI like Contrast Grid introduced in this session, or if you want to use <a href="https://help.figma.com/hc/en-us/articles/360040328653-Use-shortcuts-and-quick-actions#Quick_actions">Quick Actions</a> for execution, you need to develop a plug-in. And then, you can share your plug-ins with everyone in the world!</p><h3>Should Designers Write Code?</h3><p>I want to conclude with my personal experience with the debated question, “Should designers write code?”</p><p>At least, I believe that writing code has improved my UI design skills.</p><p>By gaining experience in manipulating Figma with JavaScript and developing plugins, you will be able to create a more structured and organized design on Figma.</p><p><strong>Plugin development not only enhances your workflow but also empowers your design.</strong></p><p>Happy Designing and Coding 👋</p><h3>Video and Slide</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FW1uwT-CUmUA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DW1uwT-CUmUA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FW1uwT-CUmUA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb09d5d3e26249ac94284eb0ebdb7b59/href">https://medium.com/media/fb09d5d3e26249ac94284eb0ebdb7b59/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.figma.com%2Fembed%3Fembed_host%3Doembed%26url%3Dhttps%3A%2F%2Fwww.figma.com%2Fproto%2FDqVq91SXjxePM18L4BaNWk%2FConfig-2022%253A-Figma-Hacks-and-Workflow-Enhancements-with-Plugins%3Fpage-id%3D88%253A1227%26node-id%3D201%253A5919%26viewport%3D227%252C-5387%252C0.46%26scaling%3Dcontain&amp;display_name=Figma&amp;url=https%3A%2F%2Fwww.figma.com%2Fproto%2FDqVq91SXjxePM18L4BaNWk%2FConfig-2022%253A-Figma-Hacks-and-Workflow-Enhancements-with-Plugins%3Fpage-id%3D88%253A1227%26node-id%3D201%253A5919%26viewport%3D227%252C-5387%252C0.46%26scaling%3Dcontain&amp;image=https%3A%2F%2Fapi-cdn.figma.com%2Fresize%2Fthumbnails%2F23e8e17f-4924-498c-b1d5-e1c0f17af052%3Fheight%3D400%26bucket%3Dfigma-alpha&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=figma" width="800" height="450" frameborder="0" scrolling="no"><a href="https://medium.com/media/c234ac6d991bbf928846d60628d33af6/href">https://medium.com/media/c234ac6d991bbf928846d60628d33af6/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14853a36ce89" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>