{"id":721,"date":"2025-08-14T00:11:52","date_gmt":"2025-08-13T15:11:52","guid":{"rendered":"https:\/\/cg-method.com\/figma\/?p=721"},"modified":"2025-08-14T00:11:53","modified_gmt":"2025-08-13T15:11:53","slug":"figma-plugin-progress-bar-enoent-fix","status":"publish","type":"post","link":"https:\/\/cg-method.com\/figma\/figma-plugin-progress-bar-enoent-fix\/","title":{"rendered":"Figma\u30d7\u30e9\u30b0\u30a4\u30f3\u2502\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u306e\u5b9f\u88c5\u65b9\u6cd5"},"content":{"rendered":"\n<p>Figma\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u958b\u767a\u3057\u3066\u3044\u308b\u3068\u3001\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\uff08\u5927\u91cf\u30ce\u30fc\u30c9\u306e\u30b9\u30ad\u30e3\u30f3\u3084CSV\u66f8\u304d\u51fa\u3057\u306a\u3069\uff09\u3067\u306f\u9032\u6357\u72b6\u6cc1\u3092\u8868\u793a\u3057\u305f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"832\" height=\"249\" src=\"https:\/\/cg-method.com\/figma\/wp-content\/uploads\/2025\/08\/2025-08-13_23h57_42.png\" alt=\"\" class=\"wp-image-722\" srcset=\"https:\/\/cg-method.com\/figma\/wp-content\/uploads\/2025\/08\/2025-08-13_23h57_42.png 832w, https:\/\/cg-method.com\/figma\/wp-content\/uploads\/2025\/08\/2025-08-13_23h57_42-300x90.png 300w, https:\/\/cg-method.com\/figma\/wp-content\/uploads\/2025\/08\/2025-08-13_23h57_42-768x230.png 768w\" sizes=\"(max-width: 832px) 100vw, 832px\" \/><\/figure>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Figma\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Figma\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u306e\u5b9f\u88c5\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u57fa\u672c\u7684\u306b\u306f\u65e2\u5b58\u30b3\u30fc\u30c9\u306e <code>reportProgress<\/code> \u2192 <code>figma.ui.postMessage<\/code> \u2192 UI \u5074 <code>window.onmessage<\/code> \u3068\u3044\u3046\u6d41\u308c\u3067\u3001%\u3092\u66f4\u65b0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">code.ts<\/h3>\n\n\n\n<p>\u4eca\u56de\u306f\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066 100 \u4ef6\u306e\u30c0\u30df\u30fc\u51e6\u7406\u3092 50ms \u9593\u9694\u3067\u9032\u3081\u308b\u4f8b\u3092\u8f09\u305b\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-ts\" data-lang=\"TypeScript\"><code>figma.showUI(__html__, { width: 400, height: 200 });\n\nfigma.ui.onmessage = async (msg) =&gt; {\n  if (msg.type === &quot;start-task&quot;) {\n    const total = 100;\n\n    for (let i = 1; i &lt;= total; i++) {\n      \/\/ \u30c0\u30df\u30fc\u306e\u91cd\u3044\u51e6\u7406\uff0850ms\u5f85\u6a5f\uff09\n      await new Promise((resolve) =&gt; setTimeout(resolve, 50));\n\n      \/\/ \u9032\u6357\u3092\u9001\u4fe1\uff08%\u8a08\u7b97\uff09\n      const percent = Math.floor((i \/ total) * 100);\n      figma.ui.postMessage({ type: &quot;progress&quot;, percent });\n    }\n\n    \/\/ \u5b8c\u4e86\u901a\u77e5\n    figma.ui.postMessage({ type: &quot;done&quot; });\n  }\n};<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">ui.html<\/h3>\n\n\n\n<p><code>&lt;progress><\/code> \u306f\u30cd\u30a4\u30c6\u30a3\u30d6\u306e<strong>\u9032\u6357\u30d0\u30fc<\/strong>\u3002<code>value<\/code> \u3068 <code>max<\/code>\uff08\u3053\u3053\u3067\u306f100\uff09\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u8868\u793a\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n  &lt;meta charset=&quot;UTF-8&quot; \/&gt;\n  &lt;style&gt;\n    body { font-family: sans-serif; padding: 16px; }\n    #progress { width: 100%; height: 20px; display: none; }\n    #status { margin-top: 8px; font-size: 12px; color: #666; }\n    button { width: 100%; padding: 8px 16px; }\n  &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;button id=&quot;startBtn&quot;&gt;\u51e6\u7406\u958b\u59cb&lt;\/button&gt;\n  &lt;progress id=&quot;progress&quot; value=&quot;0&quot; max=&quot;100&quot;&gt;&lt;\/progress&gt;\n  &lt;div id=&quot;status&quot;&gt;\u5f85\u6a5f\u4e2d&lt;\/div&gt;\n\n  &lt;script&gt;\n    const progressBar = document.getElementById(&#39;progress&#39;);\n    const status = document.getElementById(&#39;status&#39;);\n\n    document.getElementById(&#39;startBtn&#39;).addEventListener(&#39;click&#39;, () =&gt; {\n      progressBar.style.display = &#39;block&#39;;\n      progressBar.value = 0;\n      status.textContent = &#39;\u51e6\u7406\u3092\u958b\u59cb\u3057\u307e\u3057\u305f...&#39;;\n      parent.postMessage({ pluginMessage: { type: &#39;start-task&#39; } }, &#39;*&#39;);\n    });\n\n    window.onmessage = (event) =&gt; {\n      const msg = event.data.pluginMessage;\n      if (!msg) return;\n      if (msg.type === &#39;progress&#39;) {\n        progressBar.value = msg.percent;\n        status.textContent = `\u51e6\u7406\u4e2d... ${msg.percent}%`;\n      } else if (msg.type === &#39;done&#39;) {\n        status.textContent = &#39;\u5b8c\u4e86\u3057\u307e\u3057\u305f\uff01&#39;;\n        progressBar.style.display = &#39;none&#39;;\n      }\n    };\n  &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">manifest.json<\/h3>\n\n\n\n<p>\u767b\u9332\u6642\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>{\n  &quot;name&quot;: &quot;\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u4ed8\u304d\u51e6\u7406\u30b5\u30f3\u30d7\u30eb&quot;,\n  &quot;id&quot;: &quot;progress-bar-sample&quot;,\n  &quot;api&quot;: &quot;1.0.0&quot;,\n  &quot;main&quot;: &quot;code.ts&quot;,\n  &quot;ui&quot;: &quot;ui.html&quot;,\n  &quot;editorType&quot;: [&quot;figma&quot;],\n  &quot;relaunchButtons&quot;: [],\n}\n<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<ul class=\"wp-block-list is-style-num_circle\">\n<li>Figma\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\u306b\u306f\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u3092\u4ed8\u3051\u308b\u3068UX\u304c\u5411\u4e0a\u3059\u308b<\/li>\n\n\n\n<li><code>figma.ui.postMessage<\/code> \u3068 <code>&lt;progress><\/code> \u8981\u7d20\u3092\u7d44\u307f\u5408\u308f\u305b\u308c\u3070\u7c21\u5358\u306b\u5b9f\u88c5\u53ef\u80fd<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u306e\u65b9\u6cd5\u3092\u4f7f\u3048\u3070\u3001\u5927\u898f\u6a21\u306a\u30b9\u30ad\u30e3\u30f3\u51e6\u7406\u3084CSV\u51fa\u529b\u3067\u3082\u3001\u30e6\u30fc\u30b6\u30fc\u306b\u5206\u304b\u308a\u3084\u3059\u3044\u9032\u6357\u8868\u793a\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Figma\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u958b\u767a\u3057\u3066\u3044\u308b\u3068\u3001\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\uff08\u5927\u91cf\u30ce\u30fc\u30c9\u306e\u30b9\u30ad\u30e3\u30f3\u3084CSV\u66f8\u304d\u51fa\u3057\u306a\u3069\uff09\u3067\u306f\u9032\u6357\u72b6\u6cc1\u3092\u8868\u793a\u3057\u305f\u304f\u306a\u308a\u307e\u3059\u3002 \u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Figma\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002 Fig [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":724,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[145],"tags":[146],"class_list":["post-721","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-figma-tools","tag-146"],"_links":{"self":[{"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/posts\/721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/comments?post=721"}],"version-history":[{"count":1,"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/posts\/721\/revisions"}],"predecessor-version":[{"id":723,"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/posts\/721\/revisions\/723"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/media\/724"}],"wp:attachment":[{"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/media?parent=721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/categories?post=721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cg-method.com\/figma\/wp-json\/wp\/v2\/tags?post=721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}