{"id":6059,"date":"2021-09-07T11:43:57","date_gmt":"2021-09-07T11:43:57","guid":{"rendered":"https:\/\/blog.synnex.co.jp\/?p=6059"},"modified":"2021-12-20T16:42:12","modified_gmt":"2021-12-20T07:42:12","slug":"gmail-gas","status":"publish","type":"post","link":"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/","title":{"rendered":"Gmail\u306e\u691c\u7d22\u3068\u5185\u5bb9\u53d6\u5f97\u3092\u3059\u308bGAS"},"content":{"rendered":"\n<p>Gmail\u3067\u306e\u7279\u5b9a\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u3068\u30e1\u30fc\u30eb\u5185\u5bb9\u53d6\u5f97\u3092\u884c\u3046GoogleAppsScript\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u6982\u8981\">\u6982\u8981<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#%E6%A6%82%E8%A6%81\"><\/a><\/h2>\n\n\n\n<p>GoogleAppsScript\u3067\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u306b\u3064\u3044\u3066\u306e\u7d39\u4ecb\u3068\u3001\u691c\u7d22\u7d50\u679c\u306e\u30e1\u30fc\u30eb\u5185\u5bb9\u3092\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u3059GoogleAppsScript\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br>GAS\u81ea\u4f53\u306f\u66f8\u304d\u51fa\u3057\u3092\u884c\u3046\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u7d10\u3065\u3051\u308b\u5f62\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<br>GAS\u306e\u6e96\u5099\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/jp.tdsynnex.com\/blog\/google-workspace\/gas-trigger\/\">\u4ee5\u524d\u306e\u8a18\u4e8b<\/a>\u306e\u300c<a href=\"https:\/\/jp.tdsynnex.com\/blog\/google-workspace\/gas-trigger\/#1_GoogleGAS\">\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u7d10\u3065\u3044\u305fGAS\u306e\u4f5c\u6210\u65b9\u6cd5<\/a>\u300d\u306e\u9805\u76ee\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1-\u30e1\u30fc\u30eb\u691c\u7d22\u306b\u3064\u3044\u3066\">1. \u30e1\u30fc\u30eb\u691c\u7d22\u306b\u3064\u3044\u3066<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#1-%E3%83%A1%E3%83%BC%E3%83%AB%E6%A4%9C%E7%B4%A2%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6\"><\/a><\/h2>\n\n\n\n<p>GAS\u3067\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u306b\u306f<code>GmailApp.search(query)<\/code>\u3068<code>GmailApp.search(query, start, max)<\/code>\u306e2\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002<br>\u4e21\u65b9\u306b\u5171\u901a\u3059\u308b<code>query<\/code>\u304c\u691c\u7d22\u6761\u4ef6\u306b\u3042\u305f\u308a\u3001<code>start<\/code>\u3068<code>max<\/code>\u306f\u691c\u7d22\u3057\u305f\u7d50\u679c\u3092\u3069\u3053\u304b\u3089\u3069\u3053\u307e\u3067\u53d6\u5f97\u3059\u308b\u304b\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u3064\u307e\u308a<code>GmailApp.search(query, start, max)<\/code>\u306f<code>GmailApp.search(query)<\/code>\u306e\u767a\u5c55\u5f62\u3068\u3044\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>query<\/code>\uff1a\u691c\u7d22\u6761\u4ef6\u306e\u6307\u5b9a(\u8a73\u7d30\u306f\u5f8c\u8ff0)<br><code>start<\/code>\uff1a\u691c\u7d22\u7d50\u679c\u3092\u4f55\u4ef6\u76ee\u304b\u3089\u53d6\u5f97\u3059\u308b\u304b<br><code>max<\/code>\uff1a\u691c\u7d22\u7d50\u679c\u3092\u4f55\u4ef6\u5206\u53d6\u5f97\u3059\u308b\u304b<\/p>\n\n\n\n<p>\u4f8b\uff1a\u672a\u8aad\u306e\u30e1\u30fc\u30eb\u30b9\u30ec\u30c3\u30c9\u30921\u4ef6\u76ee\u304b\u308910\u4ef6\u5206\u53d6\u5f97<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-lang=\"JavaScript\"><code>const threads = GmailApp.search(&#39;is:unread&#39;, 0, 10);<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u30e1\u30fc\u30eb\u30b9\u30ec\u30c3\u30c9\u306b\u3064\u3044\u3066\">\u30e1\u30fc\u30eb\u30b9\u30ec\u30c3\u30c9\u306b\u3064\u3044\u3066<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#%E3%83%A1%E3%83%BC%E3%83%AB%E3%82%B9%E3%83%AC%E3%83%83%E3%83%89%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6\"><\/a><\/h3>\n\n\n\n<p><code>GmailApp.search(query)<\/code>\u3068<code>GmailApp.search(query, start, max)<\/code>\u3067\u5f97\u3089\u308c\u308b\u7d50\u679c\u306f\u3069\u3061\u3089\u3082\u300c\u30e1\u30fc\u30eb\u30b9\u30ec\u30c3\u30c9\u306e\u914d\u5217\u300d\u3068\u3044\u3046\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<br>\u4e0b\u8a18\u306e\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u5834\u5408\u3001Gmail\u304c\u81ea\u52d5\u7684\u306b\uff11\u3064\u306e\u30b9\u30ec\u30c3\u30c9\u3068\u3057\u3066\u30e1\u30fc\u30eb\u3092\u307e\u3068\u3081\u307e\u3059\u3002<br>\u5f53\u3066\u306f\u307e\u3089\u306a\u3044\u5834\u5408\u306f\u305d\u306e\u307e\u307e\uff11\u3064\u306e\u30e1\u30fc\u30eb\u3067\uff11\u30b9\u30ec\u30c3\u30c9\u6271\u3044\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>(1) \u53d7\u4fe1\u8005\u3001\u9001\u4fe1\u8005\u3001\u4ef6\u540d\u304c\u4ee5\u524d\u306e\u30e1\u30fc\u30eb\uff081\u9031\u9593\u4ee5\u5185\u306b\u9001\u4fe1\u3055\u308c\u3066\u3044\u308b\uff09\u3068\u540c\u3058\u3067\u3042\u308b<br>(2) \u6700\u521d\u306e\u30e1\u30fc\u30eb\u3068\u305d\u306e\u8fd4\u4fe1\u3001\u307e\u305f\u305d\u306e\u8fd4\u4fe1\u3068\u3044\u3063\u305f\u4e00\u9023\u306e\u30e1\u30fc\u30eb\u7fa4<\/p>\n\n\n\n<p>\u4f8b\uff1a\uff11\u3064\u306e\u30e1\u30fc\u30eb\u3060\u3051\u306e\u30b9\u30ec\u30c3\u30c9(\u4e0a)\u3001\u8907\u6570\u306e\u30e1\u30fc\u30eb\u304c\uff11\u3064\u306e\u30b9\u30ec\u30c3\u30c9\u306b\u306a\u3063\u3066\u3044\u308b\u30e1\u30fc\u30eb(\u4e0b)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"821\" height=\"79\" src=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/001_searchMail.png\" alt=\"\" class=\"wp-image-6061\" srcset=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/001_searchMail.png 821w, https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/001_searchMail-300x29.png 300w, https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/001_searchMail-768x74.png 768w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/figure>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u300c\u30e1\u30fc\u30eb\u30b9\u30ec\u30c3\u30c9\u306e\u914d\u5217\u300d\u306f\u3053\u308c\u3089\u306e\u30b9\u30ec\u30c3\u30c9\u9054\u306e\u30c7\u30fc\u30bf\u3067\u3067\u304d\u305f\u914d\u5217\u3092\u6307\u3057\u307e\u3059\u3002<br>\u300c\u30e1\u30fc\u30eb\u30b9\u30ec\u30c3\u30c9\u306e\u914d\u5217\u300d\u306e\u6271\u3044\u65b9\u306b\u3064\u3044\u3066\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2-\u691c\u7d22\u6761\u4ef6\u306b\u3064\u3044\u3066\">2. \u691c\u7d22\u6761\u4ef6\u306b\u3064\u3044\u3066<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#2-%E6%A4%9C%E7%B4%A2%E6%9D%A1%E4%BB%B6%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6\"><\/a><\/h2>\n\n\n\n<p>\u5b9f\u969b\u306bGAS\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u524d\u306b\u3001\u691c\u7d22\u6761\u4ef6\u306b\u3064\u3044\u3066\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\u30e1\u30fc\u30eb\u691c\u7d22\u306e\u969b\u306e<code>query<\/code>\u306f\u6587\u5b57\u5217\u3067\u6307\u5b9a\u3057\u3001\u8907\u6570\u6761\u4ef6\u3067\u691c\u7d22\u3059\u308b\u969b\u306f\u6761\u4ef6\u540c\u58eb\u306e\u9593\u306b\u30b9\u30da\u30fc\u30b9\u3092\u5165\u308c\u307e\u3059\u3002<br>\u9593\u306b\u30b9\u30da\u30fc\u30b9\u3092\u5165\u308c\u308b\u8907\u6570\u6761\u4ef6\u691c\u7d22\u306fAND\u691c\u7d22\u3068\u306a\u308a<code>\u6761\u4ef6A \u6761\u4ef6B<\/code>\u306e\u5834\u5408\u306f<code>\u6761\u4ef6A\u304b\u3064\u6761\u4ef6B<\/code>\u306e\u7d50\u679c\u304c\u30d2\u30c3\u30c8\u3057\u307e\u3059\u3002<br>OR\u691c\u7d22\u306b\u3064\u3044\u3066\u306f\u5f8c\u8ff0\u306e\u691c\u7d22\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u4f8b\uff1atest@example.com\u3092\u542b\u3080\u9001\u4fe1\u5143\u304b\u3064\u672a\u8aad\u306e\u30e1\u30fc\u30eb\u30b9\u30ec\u30c3\u30c9\u3092\u691c\u7d22<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-lang=\"JavaScript\"><code>const query = &#39;from:test@example.com is:unread&#39;\nconst threads = GmailApp.search(query);<\/code><\/pre><\/div>\n\n\n\n<p>\u6307\u5b9a\u3067\u304d\u308b\u691c\u7d22\u6761\u4ef6\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br>\u307e\u305f\u3001\u3053\u306e\u691c\u7d22\u6761\u4ef6\u3084\u8a18\u8ff0\u65b9\u6cd5\u306f\u901a\u5e38\u306e<a href=\"https:\/\/mail.google.com\/mail\/u\/0\/\">Gmail\u753b\u9762<\/a>\u3067\u306e\u691c\u7d22\u3068\u540c\u3058\u4ed5\u69d8\u3067\u3059\u3002<br>GAS\u3067\u691c\u7d22\u6761\u4ef6\u3092\u8a2d\u5b9a\u3059\u308b\u524d\u306b\u3001Gmail\u306e\u691c\u7d22\u3067\u305d\u306e\u691c\u7d22\u6761\u4ef6\u3067\u5927\u4e08\u592b\u306a\u306e\u304b\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u5b89\u5fc3\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\">\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#%E3%82%AD%E3%83%BC%E3%83%AF%E3%83%BC%E3%83%89%E6%A4%9C%E7%B4%A2\"><\/a><\/h3>\n\n\n\n<p>\u5358\u8a9e\u3084\u6587\u7ae0\u306a\u3069\u3067\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4ef6\u540d\u3084\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u540d\u306a\u3069\u691c\u7d22\u30a8\u30ea\u30a2\u3092\u7d5e\u3063\u3066\u691c\u7d22\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p><code>\u4efb\u610f\u306e\u6587\u5b57\u5217<\/code><br>\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u3092\u4ef6\u540d\u3001\u9001\u4fe1\u5143\u3001\u9001\u4fe1\u5148\u3001\u672c\u6587\u7b49\u306b\u542b\u3080\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a example \u21d2 example\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u3080\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>subject:<\/code><br>\u4ef6\u540d\u3092\u90e8\u5206\u4e00\u81f4\u3067\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a subject:example \u21d2 example\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u4ef6\u540d\u306b\u542b\u3080\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>filename:<\/code><br>\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u3092\u90e8\u5206\u4e00\u81f4\u3067\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a filename:example \u21d2 example\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u542b\u3080\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u3042\u308b\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u30a2\u30c9\u30ec\u30b9\u691c\u7d22\">\u30a2\u30c9\u30ec\u30b9\u691c\u7d22<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#%E3%82%A2%E3%83%89%E3%83%AC%E3%82%B9%E6%A4%9C%E7%B4%A2\"><\/a><\/h3>\n\n\n\n<p>\u9001\u4fe1\u5143\u3084\u9001\u4fe1\u5148\u3001CC\u3084BCC\u306a\u3069\u3092\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u307e\u305f\u306f\u540d\u524d\u306e\u4e00\u90e8\u3067\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>from:<\/code><br>\u9001\u4fe1\u5143\u3092\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u307e\u305f\u306f\u540d\u524d\u306e\u90e8\u5206\u4e00\u81f4\u3067\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a from:test@example.com\u3000\u21d2&nbsp;<a href=\"mailto:test@example.com\">test@example.com<\/a>\u3092\u542b\u3080\u9001\u4fe1\u5143\u304b\u3089\u306e\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>to:<\/code><br>\u9001\u4fe1\u5148\u3092\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u307e\u305f\u306f\u540d\u524d\u306e\u90e8\u5206\u4e00\u81f4\u3067\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>cc:<\/code><br>CC\u3092\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u307e\u305f\u306f\u540d\u524d\u306e\u90e8\u5206\u4e00\u81f4\u3067\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a cc:test@example.com\u3000\u21d2&nbsp;<a href=\"mailto:test@example.com\">test@example.com<\/a>\u3092\u542b\u3080CC\u3078\u306e\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>bcc:<\/code><br>CC\u3092\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u307e\u305f\u306f\u540d\u524d\u306e\u90e8\u5206\u4e00\u81f4\u3067\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a bcc:test@example.com\u3000\u21d2&nbsp;<a href=\"mailto:test@example.com\">test@example.com<\/a>\u3092\u542b\u3080BCC\u3078\u306e\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u30e1\u30fc\u30eb\u306e\u72b6\u614b\u60c5\u5831\u3067\u691c\u7d22\">\u30e1\u30fc\u30eb\u306e\u72b6\u614b\u30fb\u60c5\u5831\u3067\u691c\u7d22<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#%E3%83%A1%E3%83%BC%E3%83%AB%E3%81%AE%E7%8A%B6%E6%85%8B%E6%83%85%E5%A0%B1%E3%81%A7%E6%A4%9C%E7%B4%A2\"><\/a><\/h3>\n\n\n\n<p>\u65e2\u8aad\uff0f\u672a\u8aad\u3084\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u6709\u7121\u3067\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>is:unread<\/code><br>\u672a\u8aad\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>is:read<\/code><br>\u65e2\u8aad\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>has:attachment<\/code><br>\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3042\u308a\u306e\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u9001\u4fe1\u3055\u308c\u305f\u6642\u9593\u3067\u691c\u7d22\">\u9001\u4fe1\u3055\u308c\u305f\u6642\u9593\u3067\u691c\u7d22<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#%E9%80%81%E4%BF%A1%E3%81%95%E3%82%8C%E3%81%9F%E6%99%82%E9%96%93%E3%81%A7%E6%A4%9C%E7%B4%A2\"><\/a><\/h3>\n\n\n\n<p>\u30e1\u30fc\u30eb\u306e\u9001\u4fe1\u65e5\u6642\u3092\u7528\u3044\u3066\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>after:<\/code>\u3001<code>newer:<\/code><br>\u6307\u5b9a\u65e5\u4ee5\u964d\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a after:2021\/1\/10 \u21d2 2021\u5e741\u670810\u65e5\u4ee5\u964d\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>before:<\/code>\u3001<code>older:<\/code><br>\u6307\u5b9a\u65e5\u4ee5\u524d\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a before:2021\/1\/10 \u21d2 2021\u5e741\u670810\u65e5\u4ee5\u524d\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>newer_than:<\/code><br>\u6307\u5b9a\u3057\u305f\u5e74\u6570\u30fb\u6708\u6570\u30fb\u65e5\u6570\u3092\u9061\u3063\u305f\u6642\u70b9\u304b\u3089\u73fe\u5728\u307e\u3067\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a newer_than:5d \u21d2 5\u65e5\u524d\u304b\u3089\u73fe\u5728\u307e\u3067\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a newer_than:4m \u21d2 4\u30ab\u6708\u524d\u304b\u3089\u73fe\u5728\u307e\u3067\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a newer_than:3y \u21d2 3\u5e74\u524d\u304b\u3089\u73fe\u5728\u307e\u3067\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>older_than:<\/code><br>\u6307\u5b9a\u3057\u305f\u5e74\u6570\u30fb\u6708\u6570\u30fb\u65e5\u6570\u3092\u9061\u3063\u305f\u6642\u70b9\u304b\u3089\u73fe\u5728\u307e\u3067\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a older_than:30d \u21d2 30\u65e5\u524d\u3088\u308a\u4ee5\u524d\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a older_than:6m \u21d2 6\u30ab\u6708\u524d\u3088\u308a\u4ee5\u524d\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a older_than:2y \u21d2 2\u5e74\u524d\u3088\u308a\u4ee5\u524d\u306b\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4e3b\u306a\u691c\u7d22\u6761\u4ef6\u306f\u4ee5\u4e0a\u3067\u3059\u3002<br>\u4ed6\u306b\u3082\u30e1\u30fc\u30eb\u306e\u30e9\u30d9\u30eb\u3084\u91cd\u8981\u30de\u30fc\u30af\u306e\u6709\u7121\u3001\u30e1\u30fc\u30eb\u30b5\u30a4\u30ba\u306e\u5927\u5c0f\u3067\u306e\u691c\u7d22\u3082\u53ef\u80fd\u3067\u3059\u3002<br>\u305d\u308c\u3089\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/support.google.com\/mail\/answer\/7190?hl=ja\">\u516c\u5f0f\u30d8\u30eb\u30d7<\/a>\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u691c\u7d22\u30c6\u30af\u30cb\u30c3\u30af\">\u691c\u7d22\u30c6\u30af\u30cb\u30c3\u30af<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#%E6%A4%9C%E7%B4%A2%E3%83%86%E3%82%AF%E3%83%8B%E3%83%83%E3%82%AF\"><\/a><\/h3>\n\n\n\n<p>OR\u691c\u7d22\u3084\u9664\u5916\u691c\u7d22\u306a\u3069\u306e\u691c\u7d22\u30c6\u30af\u30cb\u30c3\u30af\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>OR<\/code>\u307e\u305f\u306f<code>{}<\/code><br>\u8907\u6570\u306e\u6761\u4ef6\u3044\u305a\u308c\u304b\u3092\u542b\u3080\u7d50\u679c\u304c\u30d2\u30c3\u30c8\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a subject:example OR from:test@example.com \u21d2 example\u3092\u542b\u3080\u4ef6\u540d\u306e\u30e1\u30fc\u30eb\uff08\u9001\u4fe1\u5143\u306f\u554f\u308f\u306a\u3044\uff09\u3068\u3001test@example.com\u304b\u3089\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\uff08\u4ef6\u540d\u306f\u554f\u308f\u306a\u3044\uff09\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a {subject:example from:test@example.com} \u21d2 example\u3092\u542b\u3080\u4ef6\u540d\u306e\u30e1\u30fc\u30eb\uff08\u9001\u4fe1\u5143\u306f\u554f\u308f\u306a\u3044\uff09\u3068\u3001test@example.com\u304b\u3089\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\uff08\u4ef6\u540d\u306f\u554f\u308f\u306a\u3044\uff09\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>-<\/code><br>\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u3092\u3082\u3064\u7d50\u679c\u3092\u9664\u5916\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a \u3007\u3007\u682a\u5f0f\u4f1a\u793e -\u30e1\u30eb\u30de\u30ac \u21d2 \u3007\u3007\u682a\u5f0f\u4f1a\u793e\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u3093\u3067\u304b\u3064\u3001\u30e1\u30eb\u30de\u30ac\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u307e\u306a\u3044\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a subject:-example from:test@example.com \u21d2 example\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u307e\u306a\u3044\u4ef6\u540d\u306e\u30e1\u30fc\u30eb\u3067\u304b\u3064\u3001test@example.com\u304b\u3089\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>( )<\/code>&nbsp;\u691c\u7d22\u6761\u4ef6\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a subject:(\u3007\u3007\u682a\u5f0f\u4f1a\u793e -\u30e1\u30eb\u30de\u30ac) \u21d2 \u4ef6\u540d\u306b\u3007\u3007\u682a\u5f0f\u4f1a\u793e\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u3093\u3067\u304b\u3064\u3001\u30e1\u30eb\u30de\u30ac\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u307e\u306a\u3044\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a subject:\u3007\u3007\u682a\u5f0f\u4f1a\u793e subject:-\u30e1\u30eb\u30de\u30ac \u21d2 \u4ef6\u540d\u306b\u3007\u3007\u682a\u5f0f\u4f1a\u793e\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u3093\u3067\u304b\u3064\u3001\u30e1\u30eb\u30de\u30ac\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u307e\u306a\u3044\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002(\u4e0a\u8a18\u3068\u540c\u3058)<\/p>\n\n\n\n<p><code>\"\"<\/code><br>\u6307\u5b9a\u3057\u305f\u30ad\u30fc\u30ef\u30fc\u30c9\u307e\u305f\u306f\u30d5\u30ec\u30fc\u30ba\u306b\u5b8c\u5168\u4e00\u81f4\u3059\u308b\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u3053\u3053\u3067\u3044\u3046\u5b8c\u5168\u4e00\u81f4\u306f\u4e00\u822c\u306b\u8a00\u308f\u308c\u308b\u4ed6\u306e\u6587\u5b57\u5217\u3092\u542b\u3081\u306a\u3044\u3068\u3044\u3046\u610f\u5473\u3067\u306f\u306a\u304f\u3001\u3042\u304f\u307e\u3067\u6307\u5b9a\u3057\u305f\u30ad\u30fc\u30ef\u30fc\u30c9\u305d\u306e\u3082\u306e\u3067\u691c\u7d22\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u691c\u7d22\u8a18\u53f7\u51e6\u7406\u56de\u907f\uff1a<br>\u65e5\u672c\u8a9e\u3067\u306f<code>\u3068<\/code>\u3068\u3044\u3046\u6587\u5b57\u304cAND\u691c\u7d22\u306e\u8a18\u53f7\u3068\u3057\u3066\u7528\u3044\u3089\u308c\u308b\u306e\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306a\u3069\u306b\u7528\u3044\u307e\u3059\u3002<br>\u4f8b\uff1a&nbsp;<code>\u9bad\u3068\u3070<\/code>\u3068\u3044\u3046\u5358\u8a9e\u3092\u691c\u7d22\u3057\u305f\u3044\u306e\u306b<code>\u9bad<\/code>\u307e\u305f\u306f<code>\u3070<\/code>\u3092\u542b\u3080\u30e1\u30fc\u30eb\u304c\u30d2\u30c3\u30c8\u3057\u3066\u3057\u307e\u3046 \u21d2&nbsp;<code>\"\u9bad\u3068\u3070\"<\/code>\u3068\u6307\u5b9a\u3059\u308c\u3070OK\u3002<br>\u82f1\u8a9e\u306e\u691c\u7d22\u3067\u3042\u308c\u3070<code>A or B<\/code>\u3068\u3044\u3046\u6587\u7ae0\u3092\u691c\u7d22\u3057\u305f\u3044\u306e\u306b\u3001<code>A<\/code>\u307e\u305f\u306f<code>B<\/code>\u3092\u542b\u3080\u30e1\u30fc\u30eb\u304c\u30d2\u30c3\u30c8\u3057\u3066\u3057\u307e\u3046\u306e\u3092\u907f\u3051\u308b\u70ba\u306e\u3082\u306e\u3067\u3059\u3002<br>\u4f8b\uff1a&nbsp;<code>Orange or Lemon<\/code>\u3068\u3044\u3046\u6587\u3092\u691c\u7d22\u3057\u305f\u3044\u306e\u306b<code>Orange<\/code>\u307e\u305f\u306f<code>Lemon<\/code>\u3092\u542b\u3080\u30e1\u30fc\u30eb\u304c\u30d2\u30c3\u30c8\u3057\u3066\u3057\u307e\u3046 \u21d2&nbsp;<code>\"Orange or Lemon\"<\/code>\u3068\u6307\u5b9a\u3059\u308c\u3070OK\u3002<\/p>\n\n\n\n<p>\u985e\u4f3c\u30ef\u30fc\u30c9\u56de\u907f\uff1a<br>\u901a\u5e38\u306e\u691c\u7d22\u3067\u306f\u3057\u3070\u3057\u985e\u4f3c\u306e\u30ad\u30fc\u30ef\u30fc\u30c9\u304c\u30d2\u30c3\u30c8\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308a\u3001\u3053\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u3082\u5b8c\u5168\u4e00\u81f4\u691c\u7d22\u3092\u7528\u3044\u307e\u3059\u3002<br>\u4f8b\uff1a&nbsp;<code>testing<\/code>\u3068\u3044\u3046\u5358\u8a9e\u3092\u691c\u7d22\u3057\u305f\u3044\u306e\u306b<code>test<\/code>\u3092\u542b\u3080\u30e1\u30fc\u30eb\u304c\u30d2\u30c3\u30c8\u3057\u3066\u3057\u307e\u3046 \u21d2&nbsp;<code>\"testing\"<\/code>\u3068\u6307\u5b9a\u3059\u308c\u3070OK\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3-\u30e1\u30fc\u30eb\u5185\u5bb9\u306e\u66f8\u304d\u51fa\u3057gas\">3. \u30e1\u30fc\u30eb\u5185\u5bb9\u306e\u66f8\u304d\u51fa\u3057GAS<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#3-%E3%83%A1%E3%83%BC%E3%83%AB%E5%86%85%E5%AE%B9%E3%81%AE%E6%9B%B8%E3%81%8D%E5%87%BA%E3%81%97gas\"><\/a><\/h2>\n\n\n\n<p>\u3067\u306f\u5b9f\u969b\u306b\u691c\u7d22\u6761\u4ef6\u3092\u7528\u3044\u3066GAS\u3067\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3001\u53d6\u5f97\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-\u30e1\u30fc\u30eb\u306e\u691c\u7d22\u30b9\u30ec\u30c3\u30c9\u7fa4\u306e\u53d6\u5f97\">\u30e1\u30fc\u30eb\u306e\u691c\u7d22\u30fb\u30b9\u30ec\u30c3\u30c9\u7fa4\u306e\u53d6\u5f97<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#1-%E3%83%A1%E3%83%BC%E3%83%AB%E3%81%AE%E6%A4%9C%E7%B4%A2%E3%82%B9%E3%83%AC%E3%83%83%E3%83%89%E7%BE%A4%E3%81%AE%E5%8F%96%E5%BE%97\"><\/a><\/h3>\n\n\n\n<p>\u307e\u305a\u306f\u5148\u8ff0\u306e<code>GmailApp.search(query)<\/code>\u3092\u7528\u3044\u3066\u30e1\u30fc\u30eb\u691c\u7d22\u3092\u884c\u3044\u307e\u3059\u3002<br>\u3053\u3053\u3067\u53d6\u5f97\u3067\u304d\u308b\u306e\u306f\u30b9\u30ec\u30c3\u30c9\u306e\u96c6\u307e\u308a\u3001\u3064\u307e\u308a\u30b9\u30ec\u30c3\u30c9\u7fa4\u306a\u306e\u3067<code>threads<\/code>\u3068\u3044\u3046\u5b9a\u6570\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002<br>\u306a\u305c\u5b9a\u6570\u306a\u306e\u304b\u3068\u8a00\u3046\u3068\u3001\u3053\u306e<code>threads<\/code>\u306f\u4eca\u5f8c\u53c2\u7167\u3059\u308b\u3060\u3051\u306e\u30c7\u30fc\u30bf\uff08\u66f8\u304d\u63db\u3048\u3084\u4ee3\u5165\u3092\u884c\u3046\u4e88\u5b9a\u304c\u306a\u3044\u30c7\u30fc\u30bf\uff09\u3060\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f\u4ef6\u540d\u306b\u300c\u304a\u3057\u3089\u305b\u300d\u3092\u542b\u3080\u672a\u8aad\u306e\u30e1\u30fc\u30eb\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<br>\u304a\u624b\u5143\u3067\u8a66\u3059\u969b\u306f\u3053\u306e\u6761\u4ef6\u306b\u9650\u3089\u305a\u3001\u691c\u7d22\u6761\u4ef6\u3092\u3061\u3087\u3046\u3069\u3044\u3044\u3082\u306e\u306b\u5909\u3048\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-lang=\"JavaScript\"><code>function searchMails() {\n  const query = &#39;subject:\u304a\u3057\u3089\u305b is:unread&#39;\n  const threads = GmailApp.search(query);\n}<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-\u30b9\u30ec\u30c3\u30c9\u7fa4\u304b\u3089\u30b9\u30ec\u30c3\u30c9\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u62bd\u51fa\">\u30b9\u30ec\u30c3\u30c9\u7fa4\u304b\u3089\u30b9\u30ec\u30c3\u30c9\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u62bd\u51fa<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#2-%E3%82%B9%E3%83%AC%E3%83%83%E3%83%89%E7%BE%A4%E3%81%8B%E3%82%89%E3%82%B9%E3%83%AC%E3%83%83%E3%83%89%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E3%81%AE%E6%8A%BD%E5%87%BA\"><\/a><\/h3>\n\n\n\n<p>\u5148\u8ff0\u306e\u901a\u308a\u30b9\u30ec\u30c3\u30c9\u7fa4\u306f\u30b9\u30ec\u30c3\u30c9\u306e\u914d\u5217\u3068\u3044\u3046\u5f62\u306e\u30c7\u30fc\u30bf\u3067\u3059\u3002<br>\u30b9\u30ec\u30c3\u30c9\u306b\u5bfe\u3057\u3066<code>.getMessages()<\/code>\u3092\u884c\u3046\u3053\u3068\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\uff08=\u30e1\u30fc\u30eb\uff11\u4ef6\uff09\u306e\u914d\u5217\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<br>\u4e0b\u56f3\u306e\u3088\u3046\u306a\u69cb\u9020\u306e\u30c7\u30fc\u30bf\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"345\" src=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/002_searchMail.png\" alt=\"\" class=\"wp-image-6062\" srcset=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/002_searchMail.png 600w, https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/002_searchMail-300x173.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>\u30e1\u30c3\u30bb\u30fc\u30b8\uff08=\u30e1\u30fc\u30eb\uff11\u4ef6\uff09\u3054\u3068\u306b\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u51fa\u3057\u305f\u3044\u306e\u3067\u3001forEach\u3092\u7528\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-lang=\"JavaScript\"><code>function searchMails() {\n  const query = &#39;subject:\u304a\u3057\u3089\u305b is:unread&#39;;\n  const threads = GmailApp.search(query);\n  threads.forEach(thread =&gt; {\n    const messages = thread.getMessages();\n    messages.forEach(message =&gt; {\n      \/\/ \u3053\u3053\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u6bce\u306b\u5bfe\u3059\u308b\u51e6\u7406\u3092\u8a18\u8ff0\n    });\n  });\n}<\/code><\/pre><\/div>\n\n\n\n<p>forEach\u3068\u306f\uff1a<\/p>\n\n\n\n<p>\u914d\u5217\u306b\u5bfe\u3057\u3066\u884c\u3048\u308b\u51e6\u7406\u306e\u3072\u3068\u3064\u3067\u3001GAS\u3067\u306f\u306a\u304fJavascript\u306b\u542b\u307e\u308c\u308b\u6a5f\u80fd\u3067\u3059\u3002<br>Javascript\u4ee5\u5916\u306b\u3082C++\u3084Python\u3001PHP\u306a\u3069\u5e83\u304f\u4e00\u822c\u306b\u7528\u3044\u3089\u308c\u3066\u3044\u307e\u3059\u3002<br>forEach\u306f\u914d\u5217\u306e\u4e2d\u306e\u30c7\u30fc\u30bf\u3072\u3068\u3064\u3072\u3068\u3064\u306b\u540c\u3058\u51e6\u7406\u3092\u884c\u3046\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p>forEach\u306e\u4f7f\u3044\u65b9\uff1a<\/p>\n\n\n\n<p>\u914d\u5217.forEach((\u30c7\u30fc\u30bf, \u9806\u756a, \u914d\u5217\u203b)=&gt;{ \u51e6\u7406 }) \u3068\u3044\u3046\u3088\u3046\u306a\u66f8\u304d\u65b9\u3092\u3057\u307e\u3059\u3002<br>\u914d\u5217\uff1aforEach\u51e6\u7406\u3092\u884c\u3046\u914d\u5217<br>\u30c7\u30fc\u30bf\uff1a\u914d\u5217\u306e\u4e2d\u306e\u30c7\u30fc\u30bf\uff11\u3064\uff11\u3064\u3092\u6307\u3057\u307e\u3059<br>\u9806\u756a\uff1a\u73fe\u5728\u51e6\u7406\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u304c\u914d\u5217\u306e\u4e2d\u3067\u4f55\u756a\u76ee\u306b\u5b58\u5728\u3059\u308b\u30c7\u30fc\u30bf\u304b\u3092\u6307\u3057\u307e\u3059\u30020\u756a\u76ee\uff5e\uff08\u7701\u7565\u53ef\uff09<br>\u914d\u5217\u203b\uff1aforEach\u51e6\u7406\u3092\u884c\u3063\u3066\u3044\u308b\u5bfe\u8c61\u306e\u914d\u5217\uff08\u7701\u7565\u53ef\uff09<br>\u4eca\u56de\u306e\u4f8b\u3067\u306f\u9806\u756a\u3001\u914d\u5217\u203b\u306f\u4f7f\u7528\u3057\u306a\u3044\u305f\u3081\u7701\u7565\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>forEach\u306e\u4f8b\uff1a<br><code>['\u308a\u3093\u3054', '\u30d0\u30ca\u30ca', '\u307f\u304b\u3093']<\/code>\u3068\u3044\u3046\u914d\u5217\u306b\u5bfe\u3057\u3066\u3001\u305d\u308c\u305e\u308c\u306e\u30c7\u30fc\u30bf\u3092\u5b9f\u884c\u30ed\u30b0\u306b\u8868\u793a\u3059\u308b\u4f8b\u3067\u3059\u3002<br>\u3053\u3061\u3089\u3067\u306f\u9806\u756a\u3082\u7528\u3044\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-lang=\"JavaScript\"><code>function sample() {\n  const fruitsList = [&#39;\u308a\u3093\u3054&#39;, &#39;\u30d0\u30ca\u30ca&#39;, &#39;\u307f\u304b\u3093&#39;];\n  fruitsList.forEach((fruits, index) =&gt; {\n    console.log(&#39;\u914d\u5217\u306e&#39;+ index + &#39;\u756a\u76ee\u306f&#39; + fruits);\n  });\n}<\/code><\/pre><\/div>\n\n\n\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<br>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u914d\u5217\u306e\u5185\u5bb9\u3092\uff11\u3064\u305a\u3064\u53d6\u308a\u51fa\u3057\u3066\u51e6\u7406\u3092\u884c\u3046\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=\"523\" height=\"481\" src=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/005_searchMail.png\" alt=\"\" class=\"wp-image-6063\" srcset=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/005_searchMail.png 523w, https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/005_searchMail-300x276.png 300w\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" \/><\/figure>\n\n\n\n<p><code>console.log(data)<\/code>\u306b\u3064\u3044\u3066\uff1a<\/p>\n\n\n\n<p>GAS\u3067\u3044\u3046\u3068\u5b9f\u884c\u30ed\u30b0\u306e\u90e8\u5206\u306b\u6307\u5b9a\u3057\u305f\u30c7\u30fc\u30bf\u3084\u7d50\u679c\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002<br>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306b\u3053\u308c\u3092\u4f7f\u3063\u3066\u539f\u56e0\u8abf\u67fb\u3092\u884c\u3063\u305f\u308a\u3001\u6b63\u3057\u304f\u5024\u304c\u53d6\u5f97\u3067\u304d\u3066\u3044\u308b\u304b\u306e\u78ba\u8a8d\u306b\u7528\u3044\u305f\u308a\u3057\u307e\u3059\u3002<br>\u6587\u5b57\u5217\u3068\u5909\u6570\u3092\u5408\u308f\u305b\u3066\u8868\u793a\u3059\u308b\u969b\u306a\u3069\u306f\u4e0a\u8a18\u30b3\u30fc\u30c9\u4f8b\u306e\u3088\u3046\u306b<code>+<\/code>\u3067\u7e4b\u3044\u3067\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u5185\u5bb9\u3092\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u3057\">\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u5185\u5bb9\u3092\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u3057<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#3-%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E3%81%AE%E5%86%85%E5%AE%B9%E3%82%92%E3%82%B9%E3%83%97%E3%83%AC%E3%83%83%E3%83%89%E3%82%B7%E3%83%BC%E3%83%88%E3%81%AB%E6%9B%B8%E3%81%8D%E5%87%BA%E3%81%97\"><\/a><\/h3>\n\n\n\n<p>\u30e1\u30c3\u30bb\u30fc\u30b8\uff08=\u30e1\u30fc\u30eb\uff11\u4ef6\uff09\u306e\u5185\u5bb9\u3092\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002<br>\u305d\u306e\u969b\u3001\u4ef6\u540d\u3084\u9001\u4fe1\u5143\u3001\u672c\u6587\u3001\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u305d\u308c\u305e\u308c\u5225\u306e\u5217\u306b\u66f8\u304d\u51fa\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"835\" height=\"227\" src=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/003_searchMail.png\" alt=\"\" class=\"wp-image-6064\" srcset=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/003_searchMail.png 835w, https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/003_searchMail-300x82.png 300w, https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/003_searchMail-768x209.png 768w\" sizes=\"auto, (max-width: 835px) 100vw, 835px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"3-1-\u30e1\u30c3\u30bb\u30fc\u30b8\u304b\u3089\u60c5\u5831\u306e\u53d6\u5f97\">\u30e1\u30c3\u30bb\u30fc\u30b8\u304b\u3089\u60c5\u5831\u306e\u53d6\u5f97<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#3-1-%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E3%81%8B%E3%82%89%E6%83%85%E5%A0%B1%E3%81%AE%E5%8F%96%E5%BE%97\"><\/a><\/h4>\n\n\n\n<p>\u307e\u305a\u306f\u4ef6\u540d\u3084\u9001\u4fe1\u5143\u7b49\u3092\u305d\u308c\u305e\u308c\u30e1\u30c3\u30bb\u30fc\u30b8\u304b\u3089\u53d6\u308a\u51fa\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u51e6\u7406\u306b\u3064\u3044\u3066\uff1a\uff0815\u884c\u76ee\uff5e\uff09<br>\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb<code>attachments<\/code>\u306f\u914d\u5217\u306e\u5f62\u3067\u53d6\u5f97\u3057\u307e\u3059\u304c\u3001\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u304c\u306a\u3044\u30e1\u30fc\u30eb\u306e\u5834\u5408\u306f\u7a7a\u306e\u914d\u5217\u3068\u306a\u308a\u307e\u3059\u3002<br>\u307e\u305a\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u3001\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u3063\u305f\u5834\u5408\u306f<code>attachmentList<\/code>\u306b\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u683c\u7d0d\u3057\u307e\u3059\u3002<br>\u305d\u306e\u5f8c\u5168\u3066\u306e\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u914d\u5217<code>attachmentList<\/code>\u306b\u683c\u7d0d\u3057\u305f\u3089\u3001\u4eca\u5ea6\u306f<code>.join()<\/code>\u3092\u7528\u3044\u3066\u3053\u308c\u3092\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>.join()<\/code>\u306b\u3064\u3044\u3066\uff1a<\/p>\n\n\n\n<p><code>\u914d\u5217.join(\u533a\u5207\u308a\u6587\u5b57)<\/code>\u3068\u3059\u308b\u3053\u3068\u3067\u3001\u914d\u5217\u21d2\u6587\u5b57\u5217\u306e\u30c7\u30fc\u30bf\u578b\u5909\u63db\u304c\u3067\u304d\u307e\u3059\u3002<br>\u4f8b\uff1a [\u2018\u3042\u3044\u3046\u2019,\u2018abc\u2019,\u2018\u30a4\u30ed\u30cf\u2019].join(&#8216;@&#8217;) \u21d2 \u2018\u3042\u3044\u3046@abc@\u30a4\u30ed\u30cf\u2019<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-lang=\"JavaScript\"><code>function searchMails() {\n\n  const query = &#39;subject:\u304a\u3057\u3089\u305b is:unread&#39;\n  const threads = GmailApp.search(query);\n\n  threads.forEach(thread =&gt; {\n\n    const messages = thread.getMessages();\n\n    messages.forEach(message =&gt; {\n\n      let fromData = message.getFrom(); \/\/ \u9001\u4fe1\u5143\n      let subject = message.getSubject(); \/\/ \u4ef6\u540d\n      let body = message.getPlainBody(); \/\/ \u672c\u6587\n      let attachments = message.getAttachments(); \/\/ \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u7fa4\uff08\u914d\u5217\uff09\n\n      let attachmentList = []; \/\/ \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u683c\u7d0d\u7528\u306e\u914d\u5217\n\n      if(attachments.length &gt; 0){\n        attachments.forEach(attachment =&gt; {\n\n          let name = attachment.getName();\n\n          attachmentList.push(name);\n        });\n      }\n\n      \/\/ \u914d\u5217\u21d2\u6587\u5b57\u5217\u306b\u5909\u63db\uff08&#39;,&#39;\u3067\u533a\u5207\u308a\uff09\n      attachmentList = attachmentList.join(&#39;,&#39;);\n\n    });\n  });\n}<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"3-2-\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u305b\u308b\u5f62\u306b\u6574\u5f62\">\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u305b\u308b\u5f62\u306b\u6574\u5f62<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#3-2-%E3%82%B9%E3%83%97%E3%83%AC%E3%83%83%E3%83%89%E3%82%B7%E3%83%BC%E3%83%88%E3%81%AB%E6%9B%B8%E3%81%8D%E5%87%BA%E3%81%9B%E3%82%8B%E5%BD%A2%E3%81%AB%E6%95%B4%E5%BD%A2\"><\/a><\/h4>\n\n\n\n<p>\u6b21\u306b\u3001\u53d6\u308a\u51fa\u3057\u305f\u5404\u7a2e\u30c7\u30fc\u30bf\u3092\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u305b\u308b\u5f62\uff08\u914d\u5217\uff09\u306b\u6574\u3048\u307e\u3059\u3002\uff0830\u884c\u76ee\uff09<br>\u914d\u5217\u306f<code>[\u9001\u4fe1\u5143, \u4ef6\u540d, \u672c\u6587, \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u540d\u305f\u3061]<\/code>\u3068\u3044\u3046\u5f62\u306b\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-lang=\"JavaScript\"><code>function searchMails() {\n\n  const query = &#39;subject:\u304a\u3057\u3089\u305b is:unread&#39;\n  const threads = GmailApp.search(query);\n\n  threads.forEach(thread =&gt; {\n\n    const messages = thread.getMessages();\n\n    messages.forEach(message =&gt; {\n\n      let fromData = message.getFrom(); \/\/ \u9001\u4fe1\u5143\n      let subject = message.getSubject(); \/\/ \u4ef6\u540d\n      let body = message.getPlainBody(); \/\/ \u672c\u6587\n      let attachments = message.getAttachments(); \/\/ \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u7fa4\uff08\u914d\u5217\uff09\n\n      let attachmentList = []; \/\/ \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u683c\u7d0d\u7528\u306e\u914d\u5217\n\n      if(attachments.length &gt; 0){\n        attachments.forEach(attachment =&gt; {\n\n          let name = attachment.getName();\n\n          attachmentList.push(name);\n        });\n      }\n\n      attachmentList = attachmentList.join(&#39;,&#39;);\n\n      \/\/ \u66f8\u304d\u51fa\u3057\u7528\u30c7\u30fc\u30bf\uff08\u914d\u5217\uff09\n      let data = [fromData, subject, body, attachmentList];\n\n    });\n  });\n}<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"3-3-\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u3057\">\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u3057<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#3-3-%E3%82%B9%E3%83%97%E3%83%AC%E3%83%83%E3%83%89%E3%82%B7%E3%83%BC%E3%83%88%E3%81%AB%E6%9B%B8%E3%81%8D%E5%87%BA%E3%81%97\"><\/a><\/h4>\n\n\n\n<p>\u307e\u305a\u3001\u66f8\u304d\u51fa\u3057\u3092\u884c\u3046\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3068\u30b7\u30fc\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\uff086\u884c\u76ee\uff5e\uff09<br>\u305d\u3057\u3066<code>.appendRow()<\/code>\u3092\u7528\u3044\u3066\u66f8\u304d\u51fa\u3057\u3092\u884c\u3044\u307e\u3059\u3002\uff0836\u884c\u76ee\uff5e\uff09<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-lang=\"JavaScript\"><code>function searchMails() {\n\n  const query = &#39;subject:\u304a\u3057\u3089\u305b is:unread&#39;\n  const threads = GmailApp.search(query);\n\n  \/\/ \u66f8\u304d\u51fa\u3057\u3092\u884c\u3046\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3068\u305d\u306e\u30b7\u30fc\u30c8\n  const ss = SpreadsheetApp.getActiveSpreadsheet();\n  const sheet = ss.getSheetByName(&#39;\u30e1\u30fc\u30eb\u30ea\u30b9\u30c8&#39;);\n\n  threads.forEach(thread =&gt; {\n\n    const messages = thread.getMessages();\n\n    messages.forEach(message =&gt; {\n\n      let fromData = message.getFrom(); \/\/ \u9001\u4fe1\u5143\n      let subject = message.getSubject(); \/\/ \u4ef6\u540d\n      let body = message.getPlainBody(); \/\/ \u672c\u6587\n      let attachments = message.getAttachments(); \/\/ \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u7fa4\uff08\u914d\u5217\uff09\n\n      let attachmentList = []; \/\/ \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u683c\u7d0d\u7528\u306e\u914d\u5217\n\n      if(attachments.length &gt; 0){\n        attachments.forEach(attachment =&gt; {\n\n          let name = attachment.getName();\n\n          attachmentList.push(name);\n        });\n      }\n\n      attachmentList = attachmentList.join(&#39;,&#39;);\n\n      let data = [fromData, subject, body, attachmentList];\n\n      \/\/ \u66f8\u304d\u51fa\u3057\uff08\u884c\u8ffd\u52a0\uff09\u5b9f\u884c\n      sheet.appendRow(data);\n\n    });\n  });\n}<\/code><\/pre><\/div>\n\n\n\n<p><code>sheet.appendRow(data)<\/code>\u306b\u3064\u3044\u3066\uff1a<\/p>\n\n\n\n<p>sheet\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3057\u3066\u3001\u884c\u306e\u8ffd\u52a0\u304c\u3067\u304d\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<br>\u884c\u306e\u8ffd\u52a0\u4f4d\u7f6e\u306f\u65e2\u306b\u30c7\u30fc\u30bf\u306e\u3042\u308b\u6700\u4e0b\u6bb5\u306e\u3072\u3068\u3064\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<br>\u3064\u307e\u308a\u300110\u884c\u76ee\u307e\u3067\u30c7\u30fc\u30bf\u304c\u3042\u3063\u305f\u5834\u540811\u884c\u76ee\u3068\u3057\u3066\u30c7\u30fc\u30bf\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<br>\u8ffd\u52a0\u3059\u308b\u30c7\u30fc\u30bf\u306f\u914d\u5217\u306e\u5f62\u5f0f\u3067A\u5217\u304b\u3089\u9806\u306b\u66f8\u304d\u8fbc\u307e\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<br>\u3053\u306e\u3088\u3046\u306b\u30e1\u30fc\u30eb\u306e\u5185\u5bb9\u304c\u53d6\u5f97\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"835\" height=\"341\" src=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/004_searchMail.png\" alt=\"\" class=\"wp-image-6065\" srcset=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/004_searchMail.png 835w, https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/004_searchMail-300x123.png 300w, https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/004_searchMail-768x314.png 768w\" sizes=\"auto, (max-width: 835px) 100vw, 835px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"3-4-\u66f8\u304d\u51fa\u3057\u524d\u306b\u904e\u53bb\u30c7\u30fc\u30bf\u306e\u524a\u9664\">\u66f8\u304d\u51fa\u3057\u524d\u306b\u904e\u53bb\u30c7\u30fc\u30bf\u306e\u524a\u9664<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#3-4-%E6%9B%B8%E3%81%8D%E5%87%BA%E3%81%97%E5%89%8D%E3%81%AB%E9%81%8E%E5%8E%BB%E3%83%87%E3%83%BC%E3%82%BF%E3%81%AE%E5%89%8A%E9%99%A4\"><\/a><\/h4>\n\n\n\n<p>\u691c\u7d22\u3057\u305f\u30e1\u30fc\u30eb\u306e\u66f8\u304d\u51fa\u3057\u306f\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u304c\u3001\u3053\u306e\u307e\u307e\u3067\u306f\u5b9f\u884c\u3059\u308b\u305f\u3073\u306b\u884c\u304c\u3069\u3093\u3069\u3093\u5897\u3048\u3066\u3044\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br>\u3053\u308c\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306b\u3001\u66f8\u304d\u51fa\u3057\u3092\u884c\u3046\u524d\u306b\u65e2\u306b\u30b7\u30fc\u30c8\u306b\u3042\u308b\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<br>\u30b7\u30fc\u30c8\u5185\u306e\u30c7\u30fc\u30bf\u524a\u9664\u306b\u306f\u8272\u3005\u306a\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u898b\u51fa\u3057\u884c\uff081\u884c\u76ee\uff09\u3092\u6b8b\u3057\u3066\u304a\u304d\u305f\u3044\u306e\u3067<code>.deleteRows(rowPosition, howMany)<\/code>\u3092\u7528\u3044\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\uff089\u884c\u76ee\uff5e16\u884c\u76ee\uff09<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-lang=\"JavaScript\"><code>function searchMails() {\n\n  const query = &#39;subject:\u304a\u3057\u3089\u305b is:unread&#39;\n  const threads = GmailApp.search(query);\n\n  const ss = SpreadsheetApp.getActiveSpreadsheet();\n  const sheet = ss.getSheetByName(&#39;\u30e1\u30fc\u30eb\u30ea\u30b9\u30c8&#39;);\n\n  \/\/ \u524a\u9664\u306e\u958b\u59cb\u884c\u3068\u524a\u9664\u3059\u308b\u884c\u6570\u3092\u53d6\u5f97\uff08\u8a73\u7d30\u5f8c\u8ff0\uff09\n  const rowPosition = 2;\n  const howMany = sheet.getLastRow() - 1;\n\n  \/\/ \u30c7\u30fc\u30bf\u306e\u884c\u304c\u3042\u308b\u5834\u5408\u3001\u884c\u524a\u9664\u3092\u5b9f\u884c\uff08\u8a73\u7d30\u5f8c\u8ff0\uff09\n  if(howMany &gt; 0){\n    sheet.deleteRows(rowPosition, howMany);\n  }\n\n  threads.forEach(thread =&gt; {\n\n    const messages = thread.getMessages();\n\n    messages.forEach(message =&gt; {\n\n      let fromData = message.getFrom(); \/\/ \u9001\u4fe1\u5143\n      let subject = message.getSubject(); \/\/ \u4ef6\u540d\n      let body = message.getPlainBody(); \/\/ \u672c\u6587\n      let attachments = message.getAttachments(); \/\/ \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u7fa4\uff08\u914d\u5217\uff09\n\n      let attachmentList = []; \/\/ \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u683c\u7d0d\u7528\u306e\u914d\u5217\n\n      if(attachments.length &gt; 0){\n        attachments.forEach(attachment =&gt; {\n\n          let name = attachment.getName();\n\n          attachmentList.push(name);\n        });\n      }\n\n      attachmentList = attachmentList.join(&#39;,&#39;);\n\n      let data = [fromData, subject, body, attachmentList];\n\n      sheet.appendRow(data);\n\n    });\n  });\n}<\/code><\/pre><\/div>\n\n\n\n<p><code>sheet.getLastRow() - 1<\/code>\u306b\u3064\u3044\u3066\uff1a\uff0811\u884c\u76ee\uff09<\/p>\n\n\n\n<p><code>sheet.getLastRow()<\/code>\u3067\u3001sheet\u5185\u3067\u30c7\u30fc\u30bf\u306e\u5b58\u5728\u3059\u308b\u6700\u7d42\u884c\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<br>\u4f8b\u3048\u3070\u300110\u884c\u76ee\u307e\u3067\u30c7\u30fc\u30bf\u304c\u3042\u308b\u30b7\u30fc\u30c8\u3067\u3042\u308c\u3070 10 \u3068\u3044\u3046\u6570\u5b57\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<br>\u3053\u3053\u304b\u3089-1\u3064\u307e\u308a\u898b\u51fa\u3057\u884c\u5206\u3092\u5f15\u304f\u3053\u3068\u3067\u3001\u30e1\u30fc\u30eb\u30c7\u30fc\u30bf\u306e\u3042\u308b\u884c\u6570\u3092\u53d6\u5f97\u3067\u304d\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br>\u3057\u304b\u3057\u30011\u884c\u3082\u30e1\u30fc\u30eb\u30c7\u30fc\u30bf\u304c\u306a\u304b\u3063\u305f\u5834\u5408 0-1 \u3068\u306a\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<br>\u4eca\u56de\u306e\u4f8b\u3067\u306f\u30e1\u30fc\u30eb\u30c7\u30fc\u30bf\u304c0\u4ef6\u4ee5\u4e0a\u306e\u3068\u304d\u3060\u3051\u884c\u524a\u9664\u3092\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002\uff0814\u884c\u76ee\uff09<\/p>\n\n\n\n<p><code>sheet.deleteRows(rowPosition, howMany)<\/code>\u306b\u3064\u3044\u3066\uff1a\uff0815\u884c\u76ee\uff09<\/p>\n\n\n\n<p>sheet\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3057\u3066\u3001\u6307\u5b9a\u3057\u305f\u884c\u304b\u3089\u4efb\u610f\u306e\u884c\u6570\u5206\u3092\u524a\u9664\u3067\u304d\u307e\u3059\u3002<br><code>rowPosition<\/code>\uff1a\u958b\u59cb\u884c\u3067\u3059\u30021\u884c\u76ee\u304b\u3089\u306a\u3089 1 \u30012\u884c\u76ee\u304b\u3089\u306a\u3089 2 \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br><code>howMany<\/code>\uff1a\u524a\u9664\u3059\u308b\u884c\u6570\u3067\u3059\u30023\u884c\u5206\u524a\u9664\u3059\u308b\u306a\u3089 3 \u300110\u884c\u5206\u524a\u9664\u3059\u308b\u306a\u3089 10 \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u4f8b\uff1a sheet.deleteRows(5, 6) \u21d2 5\u884c\u76ee\u304b\u30896\u884c\u5206(5~10\u884c\u76ee)\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u307e\u3068\u3081\">\u307e\u3068\u3081<a href=\"https:\/\/fg-syn-blog.appspot.com\/development\/1_gas\/searchmail.html#%E3%81%BE%E3%81%A8%E3%82%81\"><\/a><\/h2>\n\n\n\n<p>Gmail\u306e\u691c\u7d22\u3068\u691c\u7d22\u6761\u4ef6\u306e\u7d39\u4ecb\u3001\u691c\u7d22\u3067\u53d6\u5f97\u3057\u305f\u30e1\u30fc\u30eb\u306e\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3078\u306e\u66f8\u304d\u51fa\u3057\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<br>\u4eca\u56de\u306f\u7c21\u5358\u306a\u5185\u5bb9\u3068\u3044\u3046\u3053\u3068\u3067\u30e1\u30fc\u30eb\u306e\u66f8\u304d\u51fa\u3057\u524d\u306b\u4ee5\u524d\u306e\u30c7\u30fc\u30bf\u306f\u884c\u3054\u3068\u524a\u9664\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u304c\u3001\u5de5\u592b\u3059\u308c\u3070\u30e1\u30fc\u30eb\u5185\u5bb9\u3092\u78ba\u8a8d\u3057\u3066\u91cd\u8907\u3057\u306a\u3044\u3088\u3046\u306b\u884c\u8ffd\u52a0\u306a\u3069\u3082\u53ef\u80fd\u3067\u3059\u3002<br>\u4ed6\u306b\u3082\u4f8b\u3048\u3070<a href=\"https:\/\/jp.tdsynnex.com\/blog\/google\/gas-trigger\/\">\u30c8\u30ea\u30ac\u30fc<\/a>\u3092\u7528\u3044\u3066\u3001\u5b9a\u671f\u5b9f\u884c\u3067\u30e1\u30fc\u30eb\u306e\u66f8\u304d\u51fa\u3057\u3092\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br>\u662f\u975e\u3044\u308d\u3044\u308d\u3068\u5fdc\u7528\u3057\u3066\u6d3b\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"p-3 mb-4 bg-light rounded-3\">    <div class=\"container-fluid\">\n      <h4 class=\"display-6 fw-bold\"><span id=\"Google_workspace\">Google Cloud\u306e\u5c0e\u5165\u306f\u5f53\u793e\u306b\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044<\/span><\/h4>\n      <p class=\"col-md-12\">IT\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30bf\u30fc\u3067\u3042\u308bTD SYNNEX\u306fGoogle Cloud\u2122 Partner Award \u3092\u53d7\u8cde\u3059\u308b\u306a\u3069\u3001\u9577\u5e74\u306b\u308f\u305f\u308aGoogle\u2122\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u8a8d\u5b9a\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30bf\u30fc\u3068\u3057\u3066\u3001\u7dcf\u5408\u7684\u306a Google\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002\u304a\u5ba2\u69d8\u306b\u3068\u3063\u3066\u6700\u9069\u306a\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u63d0\u6848\u3084\u5c0e\u5165\u3001\u6d3b\u7528\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/p>\n      <a href=\"https:\/\/www.synnex.co.jp\/vender\/google\/inquiry\/\"><button class=\"btn btn-primary btn-lg\" type=\"button\">\u304a\u554f\u3044\u5408\u308f\u305b<\/button><\/a>\n    <\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Gmail\u3067\u306e\u7279\u5b9a\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u3068\u30e1\u30fc\u30eb\u5185\u5bb9\u53d6\u5f97\u3092\u884c\u3046GoogleAppsScript\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u6982\u8981 GoogleAppsScript\u3067\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u306b\u3064\u3044\u3066\u306e\u7d39\u4ecb\u3068\u3001\u691c\u7d22\u7d50\u679c\u306e\u30e1\u30fc\u30eb\u5185\u5bb9\u3092\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u3059G&#8230;<\/p>\n","protected":false},"author":3,"featured_media":6167,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[169],"tags":[161],"class_list":["post-6059","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google","tag-gas"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Gmail\u306e\u691c\u7d22\u3068\u5185\u5bb9\u53d6\u5f97\u3092\u3059\u308bGAS &#8211; TD SYNNEX BLOG<\/title>\n<meta name=\"description\" content=\"Gmail\u3067\u306e\u7279\u5b9a\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u3068\u30e1\u30fc\u30eb\u5185\u5bb9\u53d6\u5f97\u3092\u884c\u3046GoogleAppsScript\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u6982\u8981\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Gmail\u306e\u691c\u7d22\u3068\u5185\u5bb9\u53d6\u5f97\u3092\u3059\u308bGAS &#8211; TD SYNNEX BLOG\" \/>\n<meta property=\"og:description\" content=\"Gmail\u3067\u306e\u7279\u5b9a\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u3068\u30e1\u30fc\u30eb\u5185\u5bb9\u53d6\u5f97\u3092\u884c\u3046GoogleAppsScript\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u6982\u8981\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/\" \/>\n<meta property=\"og:site_name\" content=\"TD SYNNEX BLOG\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-07T11:43:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-20T07:42:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/gmail.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1280\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TD SYNNEX K.K.\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"TD SYNNEX K.K.\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/\",\"url\":\"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/\",\"name\":\"Gmail\u306e\u691c\u7d22\u3068\u5185\u5bb9\u53d6\u5f97\u3092\u3059\u308bGAS &#8211; TD SYNNEX BLOG\",\"isPartOf\":{\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/gmail.jpg\",\"datePublished\":\"2021-09-07T11:43:57+00:00\",\"dateModified\":\"2021-12-20T07:42:12+00:00\",\"author\":{\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/#\/schema\/person\/27a28c43d8bfc7e8087223b26535d233\"},\"description\":\"Gmail\u3067\u306e\u7279\u5b9a\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u3068\u30e1\u30fc\u30eb\u5185\u5bb9\u53d6\u5f97\u3092\u884c\u3046GoogleAppsScript\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u6982\u8981\",\"breadcrumb\":{\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/#primaryimage\",\"url\":\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/gmail.jpg\",\"contentUrl\":\"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/gmail.jpg\",\"width\":1920,\"height\":1280},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\/\/jp.tdsynnex.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google\",\"item\":\"https:\/\/jp.tdsynnex.com\/blog\/category\/google\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Gmail\u306e\u691c\u7d22\u3068\u5185\u5bb9\u53d6\u5f97\u3092\u3059\u308bGAS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/#website\",\"url\":\"https:\/\/jp.tdsynnex.com\/blog\/\",\"name\":\"TD SYNNEX BLOG\",\"description\":\"IT\u5c02\u9580\u5546\u793e\u304c\u5c4a\u3051\u308b\u60c5\u5831\u30e1\u30c7\u30a3\u30a2\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jp.tdsynnex.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/#\/schema\/person\/27a28c43d8bfc7e8087223b26535d233\",\"name\":\"TD SYNNEX K.K.\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/jp.tdsynnex.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8c78c73b44737d0e9ea65e8b304502f5d063717571c4be4b0904e52c0d3c3229?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8c78c73b44737d0e9ea65e8b304502f5d063717571c4be4b0904e52c0d3c3229?s=96&d=mm&r=g\",\"caption\":\"TD SYNNEX K.K.\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Gmail\u306e\u691c\u7d22\u3068\u5185\u5bb9\u53d6\u5f97\u3092\u3059\u308bGAS &#8211; TD SYNNEX BLOG","description":"Gmail\u3067\u306e\u7279\u5b9a\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u3068\u30e1\u30fc\u30eb\u5185\u5bb9\u53d6\u5f97\u3092\u884c\u3046GoogleAppsScript\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u6982\u8981","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/","og_locale":"ja_JP","og_type":"article","og_title":"Gmail\u306e\u691c\u7d22\u3068\u5185\u5bb9\u53d6\u5f97\u3092\u3059\u308bGAS &#8211; TD SYNNEX BLOG","og_description":"Gmail\u3067\u306e\u7279\u5b9a\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u3068\u30e1\u30fc\u30eb\u5185\u5bb9\u53d6\u5f97\u3092\u884c\u3046GoogleAppsScript\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u6982\u8981","og_url":"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/","og_site_name":"TD SYNNEX BLOG","article_published_time":"2021-09-07T11:43:57+00:00","article_modified_time":"2021-12-20T07:42:12+00:00","og_image":[{"width":1920,"height":1280,"url":"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/gmail.jpg","type":"image\/jpeg"}],"author":"TD SYNNEX K.K.","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"TD SYNNEX K.K.","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"5\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/","url":"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/","name":"Gmail\u306e\u691c\u7d22\u3068\u5185\u5bb9\u53d6\u5f97\u3092\u3059\u308bGAS &#8211; TD SYNNEX BLOG","isPartOf":{"@id":"https:\/\/jp.tdsynnex.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/#primaryimage"},"image":{"@id":"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/#primaryimage"},"thumbnailUrl":"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/gmail.jpg","datePublished":"2021-09-07T11:43:57+00:00","dateModified":"2021-12-20T07:42:12+00:00","author":{"@id":"https:\/\/jp.tdsynnex.com\/blog\/#\/schema\/person\/27a28c43d8bfc7e8087223b26535d233"},"description":"Gmail\u3067\u306e\u7279\u5b9a\u306e\u30e1\u30fc\u30eb\u691c\u7d22\u3068\u30e1\u30fc\u30eb\u5185\u5bb9\u53d6\u5f97\u3092\u884c\u3046GoogleAppsScript\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u6982\u8981","breadcrumb":{"@id":"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/#primaryimage","url":"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/gmail.jpg","contentUrl":"https:\/\/jp.tdsynnex.com\/blog\/wp-content\/uploads\/2021\/09\/gmail.jpg","width":1920,"height":1280},{"@type":"BreadcrumbList","@id":"https:\/\/jp.tdsynnex.com\/blog\/google\/gmail-gas\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/jp.tdsynnex.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Google","item":"https:\/\/jp.tdsynnex.com\/blog\/category\/google\/"},{"@type":"ListItem","position":3,"name":"Gmail\u306e\u691c\u7d22\u3068\u5185\u5bb9\u53d6\u5f97\u3092\u3059\u308bGAS"}]},{"@type":"WebSite","@id":"https:\/\/jp.tdsynnex.com\/blog\/#website","url":"https:\/\/jp.tdsynnex.com\/blog\/","name":"TD SYNNEX BLOG","description":"IT\u5c02\u9580\u5546\u793e\u304c\u5c4a\u3051\u308b\u60c5\u5831\u30e1\u30c7\u30a3\u30a2","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jp.tdsynnex.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/jp.tdsynnex.com\/blog\/#\/schema\/person\/27a28c43d8bfc7e8087223b26535d233","name":"TD SYNNEX K.K.","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/jp.tdsynnex.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8c78c73b44737d0e9ea65e8b304502f5d063717571c4be4b0904e52c0d3c3229?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8c78c73b44737d0e9ea65e8b304502f5d063717571c4be4b0904e52c0d3c3229?s=96&d=mm&r=g","caption":"TD SYNNEX K.K."}}]}},"_links":{"self":[{"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/posts\/6059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/comments?post=6059"}],"version-history":[{"count":8,"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/posts\/6059\/revisions"}],"predecessor-version":[{"id":6788,"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/posts\/6059\/revisions\/6788"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/media\/6167"}],"wp:attachment":[{"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/media?parent=6059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/categories?post=6059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jp.tdsynnex.com\/blog\/wp-json\/wp\/v2\/tags?post=6059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}