{"id":538,"date":"2025-03-21T20:58:54","date_gmt":"2025-03-21T11:58:54","guid":{"rendered":"https:\/\/cg-method.com\/photoshop\/?p=538"},"modified":"2025-03-21T22:44:39","modified_gmt":"2025-03-21T13:44:39","slug":"get-script-data-post-spreadsheet","status":"publish","type":"post","link":"https:\/\/cg-method.com\/photoshop\/get-script-data-post-spreadsheet\/","title":{"rendered":"ExtendScript\u2502\u30b9\u30af\u30ea\u30d7\u30c8\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u8a18\u9332\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>ExtendScript\uff08JSX\uff09\u3092\u4f7f\u3063\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u305f\u300c<strong>\u30e6\u30fc\u30b6\u30fc\u540d<\/strong>\u300d\u300c<strong>\u30b9\u30af\u30ea\u30d7\u30c8\u540d<\/strong>\u300d\u300c<strong>\u5b9f\u884c\u6642\u9593<\/strong>\u300d\u3092\u3001<strong>Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u81ea\u52d5\u8a18\u9332\u3059\u308b\u4ed5\u7d44\u307f<\/strong>\u3092\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3057\u3001\u30bd\u30b1\u30c3\u30c8\u901a\u4fe1\u306b\u3088\u308b\u76f4\u63a5\u9001\u4fe1\u306f\u56f0\u96e3\u3060\u3063\u305f\u305f\u3081\u3001<strong>\u30d0\u30c3\u30c1\uff0bVBS\uff0bCurl\u306b\u3088\u308b\u529b\u6280\u69cb\u6210<\/strong>\u3067\u5b9f\u73fe\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u76ee\u7684\uff1a\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u5c65\u6b74\u3092\u30ed\u30b0\u3068\u3057\u3066\u6b8b\u3057\u305f\u3044<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8ab0\u304c\u3069\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u3044\u3064\u5b9f\u884c\u3057\u305f\u304b\u3092\u8a18\u9332\u3057\u3066\u304a\u304d\u305f\u3044<\/li>\n\n\n\n<li>\u7ba1\u7406\u7528\u30ed\u30b0\u3084\u30c1\u30fc\u30e0\u5171\u6709\u7528\u306e\u5c65\u6b74\u3092\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u4fdd\u5b58\u3057\u305f\u3044<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3067\u30ed\u30b0\u53f0\u5e33\u3092\u7528\u610f<\/h2>\n\n\n\n<p>Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u4ee5\u4e0b\u306e3\u9805\u76ee\u306e\u5217\u3092\u4f5c\u6210\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"622\" height=\"242\" src=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/Screenshot_2019_0811_02.jpg\" alt=\"\" class=\"wp-image-539\" srcset=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/Screenshot_2019_0811_02.jpg 622w, https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/Screenshot_2019_0811_02-300x117.jpg 300w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">GAS\uff08Google Apps Script\uff09\u306e\u30b3\u30fc\u30c9<\/h2>\n\n\n\n<p>Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e <code>\u30c4\u30fc\u30eb &gt; \u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf<\/code> \u304b\u3089\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>function doGet(e) {\n  var rowData = {};  \n  if (e.parameter == undefined) {\n      var getvalue = &quot;undefined&quot;\n      rowData.value = getvalue;\n      var result = JSON.stringify(rowData);\n      return ContentService.createTextOutput(result);\n  }else{\n      var id = &#39;\u30b9\u30d7\u30ec\u30c3\u30c8\u30b7\u30fc\u30c8\u306eID&#39;;\n      var sheet = SpreadsheetApp.openById(id).getSheetByName(&quot;\u30b7\u30fc\u30c81&quot;);\n      var array = [ e.parameter.p1 , e.parameter.p2 , e.parameter.p3];\n      sheet.appendRow(array);\n      var getvalue = &quot;ok&quot;\n      rowData.value = getvalue;\n      var result = JSON.stringify(rowData);\n      return ContentService.createTextOutput(result);\n  }\n}<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">GAS\u306e\u30c7\u30d7\u30ed\u30a4<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30e1\u30cb\u30e5\u30fc\u300c\u516c\u958b > \u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u3057\u3066\u5c0e\u5165\u300d<\/li>\n\n\n\n<li>\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f5c\u6210\u3001\u30a2\u30af\u30bb\u30b9\u6a29\u3092\u300c\u5168\u54e1\u300d\u306b\u8a2d\u5b9a<\/li>\n\n\n\n<li>\u767a\u884c\u3055\u308c\u305fURL\u3092\u63a7\u3048\u3066\u304a\u304f\uff08<code>https:\/\/script.google.com\/macros\/s\/...\/exec<\/code>\uff09<\/li>\n<\/ol>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\u201chttps:\/\/script.google.com\/macros\/s\/\u767a\u884c\u3055\u308c\u305fID\/exec?p1=\u30b9\u30af\u30ea\u30d7\u30c8\u540d.jsx&p2=\u4f7f\u7528\u8005\u540d&p3=\u4f7f\u7528\u65e5\u6642\u201d<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">ESTK\u304b\u3089\u30d0\u30c3\u30c1\u3092\u4f7f\u3063\u3066\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u5024\u3092\u9001\u4fe1\u3059\u308b\u65b9\u6cd5<\/h2>\n\n\n\n<p>ExtendScript\u304b\u3089\u76f4\u63a5Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u5024\u3092\u9001\u4fe1\u3059\u308b\u306b\u306f\u5236\u9650\u304c\u3042\u308a\u3001\u30bd\u30b1\u30c3\u30c8\u901a\u4fe1\u3082\u4e0a\u624b\u304f\u6a5f\u80fd\u3057\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u3001<strong>ExtendScript \u2192 \u30d0\u30c3\u30c1\uff08.bat\uff09 \u2192 VBS \u2192 Curl \u2192 GAS<\/strong> \u3068\u3044\u3046\u624b\u9806\u3067\u3001\u5f37\u5f15\u306a\u304c\u3089\u3082\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u60c5\u5831\u3092\u9001\u4fe1\u3067\u304d\u308b\u4ed5\u7d44\u307f\u3092\u69cb\u7bc9\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Curl\u306e\u5c0e\u5165<\/h3>\n\n\n\n<p>\u307e\u305a\u306f\u4ee5\u4e0b\u306e\u516c\u5f0f\u30b5\u30a4\u30c8\u304b\u3089 Windows\u7248\u306eCurl \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<a href=\"https:\/\/curl.haxx.se\/windows\/\" class=\"c-blogLink -external\" data-style=\"text\" target=\"_blank\" rel=\"noopener noreferrer\">\n\t\t\t\t<!-- <i class=\"c-blogLink__icon icon-link\" role=\"presentation\"><\/i> -->\n\t\t\t\t<span class=\"c-blogLink__icon\">\n\t\t\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"swl-svg-externalLink __svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 48 48\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M44 2H30c-1.1 0-2 .9-2 2s.9 2 2 2h9.2L24 21.2c-.8.8-.8 2 0 2.8s2 .8 2.8 0L42 8.8V18c0 1.1.9 2 2 2s2-.9 2-2V4c0-1.1-.9-2-2-2z\" \/><path d=\"M41 27c-1.1 0-2 .9-2 2v10c0 1.1-.9 2-2 2H9c-1.1 0-2-.9-2-2V11c0-1.1.9-2 2-2h10c1.1 0 2-.9 2-2s-.9-2-2-2H9c-3.3 0-6 2.7-6 6v28c0 3.3 2.7 6 6 6h28c3.3 0 6-2.7 6-6V29c0-1.1-.9-2-2-2z\" \/><\/svg>\t\t\t\t<\/span>\n\t\t\t\t<span class=\"c-blogLink__text\">curl for Windows<\/span>\n\t\t\t<\/a>\n\t\t<\/div>\n\n\n<p>\u89e3\u51cd\u5f8c\u3001\u4ee5\u4e0b\u306e\u30d1\u30b9\u306b\u914d\u7f6e\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>C:\\Program Files (x86)\\curl-7.65.3-win64-mingw<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b9\u30af\u30ea\u30d7\u30c8\u5b9f\u884c\u30ed\u30b0\u3092\u9001\u4fe1\u3059\u308bExtendScript<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30b9\u30af\u30ea\u30d7\u30c8\u540d<\/li>\n\n\n\n<li>\u4f7f\u7528\u8005\u540d\uff08PC\u306e\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\uff09<\/li>\n\n\n\n<li>\u4f7f\u7528\u65e5\u6642<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u3092\u53d6\u5f97\u3057\u3066URL\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u4ed8\u4e0e\u3057\u3001Curl\u3067\u9001\u4fe1\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3057\u3066Curl\u30b3\u30de\u30f3\u30c9\u3092\u7d44\u307f\u7acb\u3066\u3001<strong>\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u304c\u8868\u793a\u3055\u308c\u306a\u3044\u3088\u3046\u306bVBS\u3067\u975e\u8868\u793a\u5b9f\u884c<\/strong>\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\/\/\u30b9\u30af\u30ea\u30d7\u30c8\u540d\u53d6\u5f97\nvar scriptName = decodeURI(File($.fileName));\nvar scriptName = getName(scriptName, 1);\nvar scriptName = encodeURI(scriptName);\n\n\/\/\u4f7f\u7528\u8005\u540d\u53d6\u5f97\nvar userName = $.getenv(&quot;HOMEPATH&quot;);\nvar userName = getName(userName, 8);\n$.writeln(userName);\n\n\/\/\u540d\u524d\u306e\u62bd\u51fa\nfunction getName(str, delStr) {\n    var str = new String(str).substring(str.lastIndexOf(&#39;\/&#39;) + delStr);\n    return str\ndObj = new Date();\n}\n\n\/\/\u30b9\u30af\u30ea\u30d7\u30c8\u4f7f\u7528\u65e5\u53d6\u5f97\nvar dObj = new Date();\nvar y = dObj.getFullYear();\nvar m = dObj.getMonth() + 1;\nvar d = dObj.getDate();\nvar h = dObj.getHours();\nvar s  = dObj.getMinutes();\nvar usedDate = y + &quot;\/&quot; + m + &quot;\/&quot; + d+ &quot;\/&quot; + h+ &quot;:&quot; + s;\n\nvar webhookUrl = &quot;https:\/\/script.google.com\/macros\/s\/******\/exec?&quot;+&quot;p1=&quot;+scriptName +&quot;&p2=&quot;+userName+&quot;&p3=&quot;+usedDate;\n\/\/\u5909\u6570\u3092\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3046\nwebhookUrl = &quot;\\&quot;&quot; + webhookUrl+ &quot;\\&quot;&quot;;\n\nfunction createBatchFile(webhookUrl) {\n    const CR = String.fromCharCode(13);\n    const BATCH_FILE = new File(Folder.temp + &quot;\/tmp.bat&quot;);       \n    BATCH_FILE.open(&quot;w&quot;);\n    BATCH_FILE.write(&quot;@echo off&quot; + CR);\n    BATCH_FILE.write(&quot;setlocal&quot; + CR);\n    BATCH_FILE.write(&quot;cd C:\/Program Files (x86)\/curl-7.65.3-win64-mingw\/bin\/&quot; + CR);\n    BATCH_FILE.write(&quot;set URL= &quot; +webhookUrl+CR);       \n    BATCH_FILE.write(&quot;curl -L %URL%&quot;+CR);  \n    BATCH_FILE.write(&quot;exit&quot;+CR);  \n    \/\/BATCH_FILE.write(&quot;pause&quot; + CR);\n    BATCH_FILE.close();\n    \/\/BATCH_FILE.execute();\n}\n\n\/\/\u5b9f\u884c\u30b3\u30de\u30f3\u30c9\ncreateBatchFile(webhookUrl);\n\n\/\/\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u958b\u304d\u305f\u304f\u306a\u3044\u306e\u3067\u3001VBS\u3092\u304b\u307e\u3059\nvar cmd = &quot;C:\\\\Library\\\\Bat\\\\test.vbs&quot;;\nvar file = new File(cmd);\nfile.execute();<\/code><\/pre><\/div>\n\n\n\n<div class=\"swell-block-accordion\">\n<details class=\"swell-block-accordion__item\" data-swl-acc=\"wrapper\"><summary class=\"swell-block-accordion__title\" data-swl-acc=\"header\"><span class=\"swell-block-accordion__label\">\u5b9f\u969b\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3064\u3051\u3066\u8a08\u6e2c\u3059\u308b<\/span><span class=\"swell-block-accordion__icon c-switchIconBtn\" data-swl-acc=\"icon\" aria-hidden=\"true\" data-opened=\"false\"><i class=\"__icon--closed icon-caret-down\"><\/i><i class=\"__icon--opened icon-caret-up\"><\/i><\/span><\/summary><div class=\"swell-block-accordion__body\" data-swl-acc=\"body\">\n<p>JSX(\u5b9f\u969b\u306b\u4f7f\u7528\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8)<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\/\/--------------------------------------------------\n\/\/ \u30b9\u30af\u30ea\u30d7\u30c8\u8a08\u6e2c\n\/\/--------------------------------------------------\n#include &#39;C:\\\\Library\\\\ESTK\\\\scriptLog.jsx&#39;;\n\nvar script = $.fileName;\nvar user = $.getenv(&quot;HOMEPATH&quot;);\nvar date = new Date();\n$.writeln(script + user + date);\ntry {\n    scriptLog(script, user, date);\n} catch (e) {}\n\n\/\/--------------------------------------------------\n\/\/ \u5b9f\u969b\u306e\u51e6\u7406    \n\/\/--------------------------------------------------\nalert(&quot;\u30c6\u30b9\u30c8!&quot;);\n<\/code><\/pre><\/div>\n\n\n\n<p>JSX\uff08\u53c2\u7167\u5148\uff09<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>function scriptLog(script,user,date){\n\n    var scriptName = decodeURI(File(script));\n    var scriptName = getName(scriptName, 1);\n    var scriptName = encodeURI(scriptName);\n\n    var userName = user;\n    var userName = getName(userName, 8);\n\n    function getName(str, delStr) {\n        var str = new String(str).substring(str.lastIndexOf(&#39;\/&#39;) + delStr);\n        return str\n        dObj = new Date();\n    }\n\n    var dObj = date;\n    var y = dObj.getFullYear();\n    var m = dObj.getMonth() + 1;\n    var d = dObj.getDate();\n    var h = dObj.getHours();\n    var s = dObj.getMinutes();\n    var usedDate = y + &quot;\/&quot; + m + &quot;\/&quot; + d + &quot;\/&quot; + h + &quot;:&quot; + s;\n\n    var webhookUrl = &quot;https:\/\/script.google.com\/macros\/s\/******\/exec?&quot; + &quot;p1=&quot; + scriptName + &quot;&p2=&quot; + userName + &quot;&p3=&quot; + usedDate;\n    var webhookUrl = webhookUrl.replace( \/%\/g , &quot;%%&quot; ) ;   \n    var webhookUrl = &quot;\\&quot;&quot; + webhookUrl + &quot;\\&quot;&quot;;\n\n    function createBatchFile(webhookUrl) {\n        const CR = String.fromCharCode(13);\n        const BATCH_FILE = new File(Folder.temp + &quot;\/tmp.bat&quot;);\n        BATCH_FILE.open(&quot;w&quot;);\n        BATCH_FILE.write(&quot;@echo off&quot; + CR);\n        BATCH_FILE.write(&quot;setlocal&quot; + CR);\n        BATCH_FILE.write(&quot;cd C:\/Program Files (x86)\/curl-7.65.3-win64-mingw\/bin\/&quot; + CR);\n        BATCH_FILE.write(&quot;set URL= &quot; + webhookUrl + CR);\n        BATCH_FILE.write(&quot;curl -L %URL%&quot; + CR);\n        BATCH_FILE.write(&quot;exit&quot; + CR);\n        \/\/BATCH_FILE.write(&quot;pause&quot; + CR);\n        BATCH_FILE.close();\n        \/\/BATCH_FILE.execute();\n    }\n\n    createBatchFile(webhookUrl);\n    var cmd = &quot;C:\\\\Library\\\\Bat\\\\test.vbs&quot;;\n    var file = new File(cmd);\n    file.execute();\n}<\/code><\/pre><\/div>\n<\/div><\/details>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u25b6 VBS\u306e\u5185\u5bb9\uff08<code>test.vbs<\/code>\uff09<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>Set ws = CreateObject(&quot;Wscript.Shell&quot;) \nws.run &quot;cmd \/c C:\\Users\\min\\Desktop\\tmp.bat&quot;, vbhide <\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9f\u884c\u7d50\u679c<\/h3>\n\n\n\n<p>\u3053\u306e\u4ed5\u7d44\u307f\u3092\u5c0e\u5165\u3059\u308c\u3070\u3001ExtendScript\u306e\u5b9f\u884c\u6642\u306b\u30ed\u30b0\u60c5\u5831\u304c\u81ea\u52d5\u7684\u306b\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3078\u9001\u4fe1\u3055\u308c\u3001\u8a18\u9332\u3068\u3057\u3066\u6b8b\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"282\" src=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/Screenshot_2019_0811_03.jpg\" alt=\"\" class=\"wp-image-541\" srcset=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/Screenshot_2019_0811_03.jpg 630w, https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/Screenshot_2019_0811_03-300x134.jpg 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u88dc\u8db3\uff1a\u65e5\u672c\u8a9e\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u540d\u304c\u6587\u5b57\u5316\u3051\u3059\u308b\u554f\u984c<\/h3>\n\n\n\n<p>\u5f53\u521d\u3001\u65e5\u672c\u8a9e\u540d\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u304cURL\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u3066\u3082\u6b63\u5e38\u306b\u9001\u4fe1\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001<br><strong>\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u5185\u3067 <code>%<\/code> \u3092 <code>%%<\/code> \u306b\u7f6e\u63db<\/strong>\u3059\u308b\u3053\u3068\u3067\u89e3\u6c7a\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>var webhookUrl = webhookUrl.replace( \/%\/g , &quot;%%&quot; ) ;   <\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">[\u88dc\u8db3] BridgeTalk\u3067\u306e\u9001\u4fe1\u65b9\u6cd5\uff08GAS\u9023\u643a\uff09<\/h2>\n\n\n\n<p>Bridge\u3092\u7d4c\u7531\u3057\u3066\u901a\u4fe1\u3059\u308b\u3053\u3068\u3067\u3001Curl\u3084\u30d0\u30c3\u30c1\u3092\u4f7f\u308f\u305a\u306b\u901a\u4fe1\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3057\u3001\u5b9f\u884c\u306b\u306fBridge\u304c\u5e38\u99d0\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"550\" src=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/Screenshot_2019_0812_01.jpg\" alt=\"\" class=\"wp-image-540\" srcset=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/Screenshot_2019_0812_01.jpg 703w, https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/Screenshot_2019_0812_01-300x235.jpg 300w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/figure>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>BridgeTalk.prototype.sendSynch = function(timeout) {\n\tvar self = this;\n\tself.onResult = function(res) {\n\tthis.result = res.body;\n\tthis.complete = true;\n\t}\n\tself.complete = false;\n\tself.send();\n\n\tif (timeout) {\n\t\tfor (var i = 0; i &lt; timeout; i++) {\n\t\t\tBridgeTalk.pump(); \/\/ process any outstanding messages\n\t\t\tif (!self.complete) {\n\t\t\t\t$.sleep(1000);\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar res = self.result;\n\tself.result = self.complete = self.onResult = undefined;\n\treturn res;\n}\n\/\/ for typos, provide an alias\nBridgeTalk.prototype.sendSync = BridgeTalk.prototype.sendSynch;\n\nfunction loadUrl(url, timeout) {\n    var bt = new BridgeTalk();\n    bt.target = &#39;bridge&#39;;\n    var httpTimeout = timeout;\n \n    var script = &#39;&#39;;\n    script += &quot;if ( !ExternalObject.webaccesslib )\\n&quot;;\n    script += &quot;  ExternalObject.webaccesslib = new ExternalObject(&#39;lib:webaccesslib&#39;);\\n&quot;;\n    script += &quot;var response = null;\\n&quot;;\n    script += &quot;var retry = true;\\n&quot;;\n    script += &quot;while (retry) {\\n&quot;;\n    script += &quot;  var http = new HttpConnection(&#39;&quot; + url + &quot;&#39;) ; \\n&quot;;\n    script += &quot;  http.timeout  = &quot; + httpTimeout + &quot;;\\n&quot;;\n    script += &quot;  http.execute() ;\\n&quot;;\n    script += &quot;  try{\\n&quot;;\n    script += &quot;    response = http.response;\\n&quot;;\n    script += &quot;    retry = false;\\n&quot;;\n    script += &quot;  } catch (e){\\n&quot;;\n    script += &quot;    BridgeTalk.bringToFront(&#39;bridge&#39;);\\n&quot;;\n    script += &quot;    if (!confirm(&#39;There was an error communicating with the server. Would you like to retry?&#39;))\\n&quot;;\n    script += &quot;      retry = false;\\n&quot;;\n    script += &quot;  }\\n&quot;;\n    script += &quot;}\\n&quot;;\n    script += &quot;response;\\n&quot;;\n \t\n    bt.body = script;\n    return bt.sendSynch(timeout);\n}\n\nalert(loadUrl(&#39;http:\/\/rpc.geocoder.us\/service\/csv?address=1600+Pennsylvania+Ave,+Washington+DC&#39;,50));<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u304a\u307e\u3051\uff1aWeb\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u30b5\u30f3\u30d7\u30eb<\/h2>\n\n\n\n<p>\u30bd\u30b1\u30c3\u30c8\u901a\u4fe1\u3067WEB\u304b\u3089\u30c7\u30fc\u30bf\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>function getHttpResponse(requests) {\n    var parseUrl = function(url) {\n        var urlObj = {};\n        \/\/[url, scheme, slash, host, port, path, query, fragment] via O&#39;REILLY JavaScript: The Good Parts  \n        var url_re = \/^(?:([A-Za-z]+):)?(\\\/{0,3})([0-9.\\-A-Za-z]+)(?::(\\d+))?(?:\\\/([^?#]*))?(?:\\?([^#]*))?(?:#(.*))?$\/;\n        var m = url_re.exec(url);\n        urlObj.host = m[3];\n        urlObj.port = m[4] || &#39;80&#39;;\n        urlObj.path = m[5];\n        urlObj.query = (m[6]) ? &#39;?&#39; + m[6] : &#39;&#39;;\n        urlObj.frag = (m[7]) ? &#39;#&#39; + m[7] : &#39;&#39;;\n        return urlObj;\n    }\n    var urlObj = parseUrl(requests.url);\n    var encoding = requests.encoding || &#39;UTF-8&#39;;\n    var method = requests.method || &#39;GET&#39;;\n    var auth = (requests.basic_auth != undefined) ? &#39;Authorization: Basic &#39; + requests.basic_auth + &#39;\\r\\n&#39; : &#39;&#39;;\n    var conn = new Socket;\n    conn.timeout = 10;\n    if (conn.open(urlObj.host + &#39;:&#39; + urlObj.port, encoding)) {\u3000\u3000\n        conn.write(method + &#39; \/&#39; + urlObj.path + urlObj.query + urlObj.frag + &#39; HTTP\/1.0\\r\\n&#39; + &#39;Host: &#39; + urlObj.host + &#39;\\r\\n&#39; + &#39;User-Agent: &#39; + &#39;InDesign\/6.0&#39; + &#39;(Macintosh; U; Intel Mac OS X 10_5_6; ja-jp)&#39; + &#39;\\r\\n&#39; + auth + &#39;\\r\\n&#39;);\n        var reply = conn.read(999999);\n        conn.close();\n        return reply; \/\/\u30d8\u30c3\u30c0\u8fbc\u307f\u3067\u8fd4\u3059  \n    } else {\n        return conn.error;\n    }\n}\n\n\/\/Web\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b  \nfunction downloadFile(url, localFile) {\n    var rep = getHttpResponse({\n        method: &#39;GET&#39;,\n        url: url,\n        encoding: &#39;BINARY&#39;,\n    });\n    if (rep.match(\/HTTP.*\\d{3}\/).toString().indexOf(&#39;200&#39;) != -1) {\n        \/\/\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u30d8\u30c3\u30c0\u3092\u9664\u53bb   \n        var body = rep.slice(rep.indexOf(&#39;\\r\\n\\r\\n&#39;) + 4);\n        \/\/\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057  \n        var f = new File(localFile);\n        if (f.open(&quot;w&quot;)) {\n            f.encoding = &#39;BINARY&#39;;\n            f.write(body);\n        }\n        f.close();\n        return f;\n    } else {\n        return false;\n    }\n}\n\n\/\/\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\n\/\/var f = downloadFile(&#39;https:\/\/www.cg-method.com\/blog\/&#39;, &#39;~\/Desktop\/cg-method.txt&#39;);  \n\n\/\/\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\n\/\/var f = downloadFile(&#39;https:\/\/www.cg-method.com\/download\/5652\/&#39;, &#39;~\/Desktop\/CGM_SavePng.jsx&#39;);  \n\n\/\/\u753b\u50cf\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\nvar f = downloadFile(&#39;https:\/\/secure.gravatar.com\/avatar\/077a21e2303f1efa3d3a5ecbf5e5193d?s=100&d=mm&r=g&#39;, &#39;~\/Desktop\/suimin.png&#39;);\n\nif (f) {\n    alert(f.name + &#39;\u3092\u4fdd\u5b58\u3057\u307e\u3057\u305f\u3002&#39;);\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\">\n<li>ExtendScript\u5358\u4f53\u3067\u306e\u30cd\u30c3\u30c8\u901a\u4fe1\u306f\u5236\u9650\u304c\u591a\u3044<\/li>\n\n\n\n<li>GAS\u3068Curl\u3092\u4f7f\u3048\u3070\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u9023\u643a\u304c\u53ef\u80fd<\/li>\n\n\n\n<li>\u30bd\u30b1\u30c3\u30c8\u901a\u4fe1\u3084BridgeTalk\u3092\u4f7f\u3048\u3070\u6539\u5584\u306e\u4f59\u5730\u3042\u308a<\/li>\n\n\n\n<li>\u30d0\u30c3\u30c1\u3068VBS\u306e\u4f75\u7528\u3067\u88cf\u5074\u3067\u306e\u81ea\u52d5\u8a18\u9332\u3082\u53ef\u80fd<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>ExtendScript\uff08JSX\uff09\u3092\u4f7f\u3063\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u305f\u300c\u30e6\u30fc\u30b6\u30fc\u540d\u300d\u300c\u30b9\u30af\u30ea\u30d7\u30c8\u540d\u300d\u300c\u5b9f\u884c\u6642\u9593\u300d\u3092\u3001Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u81ea\u52d5\u8a18\u9332\u3059\u308b\u4ed5\u7d44\u307f\u3092\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u305f\u3060\u3057\u3001\u30bd\u30b1\u30c3\u30c8\u901a\u4fe1\u306b\u3088\u308b\u76f4\u63a5\u9001\u4fe1\u306f\u56f0\u96e3\u3060 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":542,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[19],"tags":[9],"class_list":["post-538","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-extendscript","tag-free"],"_links":{"self":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/comments?post=538"}],"version-history":[{"count":2,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/538\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/538\/revisions\/555"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media\/542"}],"wp:attachment":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media?parent=538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/categories?post=538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/tags?post=538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}