Googleãã©ã¼ã ã®èªåè¿ä¿¡ã®éä¿¡å
(from)ã¯ãããã©ã«ãã§ã¯ãã®ã¢ã«ã¦ã³ãã®Gmailã§ããGoogle Apps Scriptã¨Gmailã®è¨å®ãå¿
è¦ã«ãªãã®ã§ãããæé ããåããã°èª°ã§ãã§ãã¾ããã Google Apps Scriptã®ã¹ã¯ãªããã¨ãã£ã¿ã§ã¯ãæ§ã
ãªæ¡ä»¶ã§ããªã¬ã¼ãè¨å®ããè¨å®ããå
容ã«åºã¥ãã¦èªåã§ã¹ã¯ãªãããå®è¡ããäºãã§ãã¾ãã ä»åã¯ããªã¬ã¼ã®è¨å®æ¹æ³ããããªã¬ã¼ã®ç¨®é¡ã«ã¤ãã¦ãç´¹ä»ãã¦ããã¾ãã ®ç°ããªããã確èªã éããããã°ãããã使ã£ã¦ ifã§ä»åããåºæ¥ããã¨æãã¾ãã ãã©ã³ãã®ãµã¤ãºãå¤æ´ããã«ã¯ã次ã®ã¡ã½ããã使ãã¾ãã ... åå¿è
ã®æ¹ãé çªã«èªãã§ãã ãã§gasã®åºç¤ã³ã¼ããç解åºæ¥ç¶ããèª â¦ ¨é権éããåé¤ããæ¹æ³ãç´¹ä»ãã¦ãã¾ããGSuiteãã¡ã¤ã³ã®æ¨©éãèæ
®ããå¦çã§ãã ã¼ãã®å¤å¤æ´ã§gasãèªåå®è¡ããæ¹æ³ ãªããããã¯æ¡ä»¶ä»ãæ¸å¼ã§å¯¾å¿ã§ãã¾ãããã®ãããgasã§ããããå®è£
ããå¿
è¦ã¯ããã¾ããã ã¼ãã®ã¹ã¯ãªããã使ã£ã¦ã¿ã¾ãããã¿ã¤ãã«ã®éããã¯ãããã¼ã¹ã«ãã¦ç°¡åãªå¦çãä½ã£ãã®ã§ãä»åã®ã¨ã³ããªã§ã¯ãã®æµãããåå¿è
ã®æ¹ã§ãå§ããããã³ãã¿ãããªã¨ ⦠ã¼ãã®ååãå¤æ´ãã¾ãã [ãã¼ã«]â[ã¹ã¯ãªããã¨ãã£ã¿]ãé¸æãã¾ãã GASç¨ã®ã¨ãã£ã¿ç»é¢ã表示ããã¾ãããã®ç»é¢ã«Google Apps Scriptãè¨è¿°ãå®è¡ãã¾ãã ç°¡åãªã³ã¼ããå®è¡ãã. å®è¡ããã¨æ¬¡ã®ããã«ãªãã¾ãã ... ãã©ã³ãã®ãµã¤ãºãå¤æ´ãã. 大ãªã³ã¼ããæ¸ãã®ã¯å¯è½ã ã管çã大å¤, å®å
¨ãªãã¼ã«ã«ã§ã®éçºã¯é£ãã. æ¥åæ
å½è
ããæ¥åæ
å½è
ã®ããã«ããªã¢ã«ãªGASï¼Google Apps Scriptï¼å©ç¨ã®ãã¦ãã¦ãç´¹ä»ãã¾ããå®éã«éç¨ãã¦ããã³ã¼ããå
¬éï¼ GASã¨ã¯ã»ã»ï¼ Google Apps Scriptã¨ã¯ä½ãªã®ãï¼å®ç¾©çãªãã®ã¯æ£ç´èªåã«ãããå ⦠ã¼ãã®ãã¼ã¸ã«æ»ãã¨ãæ°ãããGASå®è¡ãã¨ãããã¿ã³ãå¢ãã¦ãã¾ãããããããGoogleã°ã«ã¼ãã¡ã³ãã¼å¤æ´ãã®ããã°ã©ãã³ã°ããå®è¡ããã㨠⦠GASï¼Google Apps Scriptï¼ã«ã¯æ³¨æãã¹ãæ©è½å¶éã4ã¤ããã¾ããâ å®è¡æéã®å¶éï¼ä¸é6åï¼â¢å®è¡åæ°ã®å¶éâ¡ããªã¬ã¼æ°ã®å¶éâ£ãã¡ã¤ã«å®¹éã®å¶éã®4ã¤ã§ããä¸éå¤ã«ãã£ã¦éç¨æ¹æ³ãå¤ãããã¨ãããã®ã§æ³¨æãã¾ãããã ãªã¹ã1ã®ãgetValue()ãããgetValues()ãã«å¤æ´ãã¦å®è¡ããã¨ãå³3ã®ããã«è¡¨ç¤ºãããã å³3 å
¨ã¦ã®å¤ãåå¾ãã ã»ã«ã«å¤ãå
¥åãè¡æ°ãåæ°ãåå¾ ¨éããæã¨ãï¼ã§èªåçã«å®è¡ãããæ©è½ã®ãã¨ã§ããååããã®1ã§ã¯ã¹ã¯ãªããã¨ãã£ã¿ã¼ããããªã¬ã¼ã åã®ããã ããã§ãã ã許å¯ã確èªããã¯ãªãã¯ãã¾ãã¨ãããªãã¿ã®èªè¨¼ã®ç»é¢ã表示ããã¾ãã®ã§ãã¢ã«ã¦ã³ãã®é¸æã§ãèªèº«ã®ã¢ã«ã¦ã³ããã¯ãªãã¯ãã¾ãã ãã®ã¢ããªã¯ç¢ºèªããã¦ãã¾ãã ãã®ã¢ããªã¯ãGoogle ã«ãã確èªãæ¸ãã§ãã¾ãããããç¥ã£ã¦ã ⦠åããã ãnpm install @google/clasp -gããå®è¡ããã 4: GoogleAPI: Googleã«ä»»æã®ã¢ã«ã¦ã³ãã§ãã°ã¤ã³ãã¦ããã¾ãã ããã¦ããã¡ãã§APIããªã³ã«å¤æ´ãã¾ãã ç°¡åãªã³ã¼ããæ¸ãã¦ã¿ã¾ãããã以ä¸ã®ã³ã¼ãã¯ãHeyï¼ ã¹ã¯ãªãããæ°è¦ã§éãã¨ã以ä¸ã®ãããªç»é¢ã«ãªãã¾ããã ããã©ã«ãã§ä»¥ä¸ã®ãããªã¹ã¯ãªãããããã§ã«æ¸ãè¾¼ã¾ãã¦ããã¯ãã§ãã ããã¯ããmyFunctionãã¨ããååã®é¢æ°ã§ãã é¢æ°ã¨ããã®ã¯ãä¸é£ã®å¦çãã¾ã¨ãããã®ã«ååãã¤ãããã®ã§ãã¹ã¯ãªããã®å®è¡åä½ã¨ãªãã¾ãã é¢æ°ãå®ç¾©ããå ´åã¯ãä¸è¨ã®ããã«functionãã¼ã¯ã¼ãã使ã以ä¸ã®ããã«è¨è¿°ãã¾ãã æ³¢æ¬å¼§ï¼{}ï¼ã®éããããã¯ã¨ããããã®é ⦠ã§ã³ã«ã¢ã¯ã»ã¹ã§ããã¦ã¼ã¶ã¼ã ããèªåã ãã以å¤ã«å¤æ´ãã¦ä¸ããã é¢æ° myFunction ãé¸æãã¦å®è¡ãã¾ãã GAS ã®ååå®è¡æã¯ã¢ã¯ã»ã¹æ¨©ã®æ¿èªãæ±ãããã¾ãã®ã§ãGAS ã使ç¨ãã¦ãã Google ã¢ã«ã¦ã³ãã§è¨±å¯ãã¾ãã å®éã«ãã¼ã¿ãåå¾ã§ããã®ã確èªãã¦ã¿ã¾ãã ã¡ãã¥ã¼ãã 表示 â ãã° ãé¸æãï¼Ctrl + Enter ã§ãå¯ï¼ ã¾ãã¯ããã¡ã¤ã«åãå¤æ´ãã¾ããããç»åã®ãé¨åãã¯ãªãã¯ãããRenameããé¸æãããã¨ã§ãååãå¤æ´ã§ãã¾ãã ãã®è¨äºã§ã¯ãGoogle Apps Scriptï¼GASï¼ã«ã¤ãã¦ãç¹å¾´ãã§ãããã¨ã使ãæ¹ãæ´»ç¨äºä¾ãªã©ããåå¿è
ã«ããããããã解説ãã¦ãã¾ããGASã¯ãGoogleã®ãµã¼ãã¹ã使ããç¡æã§æ¥åãå¹çåããæ段ã¨ãã¦æ³¨ç®ããã¦ãã¾ãããã®è¨äºãèªã¿ãGASå
¥éãã¾ãããã åå¿è
ã«ã¨ã£ã¦ã¯ãä½ããªãã ãããããªãã§ããããä¸è¨ã§ä¸ã¤ä¸ã¤èª¬æãã¦ããã¾ãã é¢æ°åãè¨å®ããã. ã¼ãã¯ä»¥ä¸ã®ãããªãã®ã§ãã ã¹ã¯ãªããã¨ãã¦ã¯ã2è¡ç®ããä¸æ¹åã«èµ°æ»ãã¦ãDåã®ãisSendãã®åã«ãTRUEãã¨å
¥ã£ã¦ããªãè¡ãè¦ã¤ããã 1. åè¨ãéç¥ï¼ä»ã¯ãã°åºåã¨ãã¦ãã¾ããï¼ 2. ãã®è¡ãã®DåããTRUEãã¨å
¥åãã ã¨ããåä½ãç®æãã¦ãã¾ãã ããã¦ãååã¾ã§ã§ä½æããã¹ã¯ãªããã¯ãã¡ãã§ãã 2è¡ç®ããèµ°æ»ãã¦ãDåããTRUEãã§ãªããã°ãåè¨ã§ããAåã®å¤ããã°åºå ⦠ã¼ãï¼ãç»å ´ãã¾ãããã¡ã¤ã«aâgasãå®è¡ãããã¡ã¤ã«ããã®ãã¡ã¤ã«ã«å¾è¿°ããgasãè¨è¼ããã¦ããããã¡ã¤ã«bâãã¡ã¤ã«aã®gasã«ãã£ã¦ãã®ãã¡ã¤ã«ã«å¤ãæ¸ãè¾¼ã¾ããã ãã¡ã¤ã«aã«ããgasfunc ã¹ãã ãSUPPLIER by RENOSYï¼ä»¥ä¸SUPPLIERï¼ãã®éçºãè¡ã£ã¦ãã¾ãã www.ga-tech.co.jp ï¼ããã«ç§ã¯è¼ã£ã¦ãã¾ããããããä¸äººãã®æ¹ã§ãã ã¹ãã ãä½ã£ã¦ã¿ã話 March 17, 2020 24 minute read . gasã®æ°ideãé©ç¨ãããã®ã§è§¦ã£ã¦ã¿ã¦ããã£ããã¨ãæ¸ãã¦ããã¾ããå¤æ´ç¹ãå人çãªæ¸å¿µç¹ãå«ãã¦ãæ¦ã好è©ä¾¡ãªã®ã§ãããã©ããã¦ãç´å¾ãããªãå¤æ´ã1ç¹ãããæ¸å¿µç¹ã¨ãã¦ç´¹ä»ããã¦ããã ⦠ã¼ããéãã, ãã¡ã¤ã«ï¼ããã¸ã§ã¯ãã®ããããã£ãããããã¹ã¯ãªããIDããã¡ã¢ãï¼ã³ããï¼, ã¿ã¼ããã«ã«ãclasp clone xxxxxxxxxxxxxxxãã¨å
¥åãã¨ã³ã¿ã¼ã, ããã¨ããã¡ã¤ã«é¡ãåºæ¥ä¸ããã, â»ããããæ°è¦ã«ä½æãããããªãsrcããã©ã«ãã¯ä½æãããªãã, ãã®å¾ã¯ãLoginããªãã¦ããã¹ã¯ãªããIDã¯å
¥ããªãã¦ã以éã®å¦çã¯ã§ããã, ã¿ã¼ããã«ã«ãclasp pullãã¨å
¥åãã¨ã³ã¿ã¼ã§GASå´ããå¼ã£å¼µã£ã¦ãããã, ãã©ã¦ã¶å´ã§ã®ãã¡ã¤ã«ã®renameã¯ãvscodeã§pullããã¨æ°ãããã¡ã¤ã«ã¨ãã¦èªèããã模æ§ã, vscodeå´ã§ã®ãã¡ã¤ã«ã®renameå¾ã«ãvscodeã§pushããã¨ãã¡ã¤ã«åãå¤ãã£ãããã«èªèããã模æ§ãï¼â»deleteâinsertãªã®ããï¼, Googleã®ã¢ã«ã¦ã³ããè¤æ°æã£ã¦ããå ´åã®æå, you can read useful information later efficiently. ãµã¤ããéç¨ãã¦ããã¨ããã©ã¼ã ã£ã¦é
ç½®ãããã§ãããããã®ãã©ã¼ã ã®ãéä¿¡ããJavaScriptã§ã³ã³ããã¼ã«ã§ããã£ã¦ãåç¥ã§ããï¼ãã®è¨äºã§ã¯JavaScriptã§éä¿¡ãã³ã³ããã¼ã«ãããsubmitã¤ãã³ãã«ã¤ãã¦è©³ãã解説ãã¦ãã¾ãï¼ ã¹ãã ã®éçºãããªãããã®å¨è¾ºã®æ¥åãã¼ã«ã®å¶ä½ãæ
å½ãã¦ãã¾ãããã¡ãã®è¨äºã§ã¯Google Apps Script(GAS)ã使ã£ã¦ã¢ãã¬ã«ååã®æ¤åçµæãç»é²ãããã¼ã«ãä½ãä¸ã§ãã¤ã³ãã¨ãªã£ãé¨åãå
±æãã¾ãã Google Apps Script(以éGAS)ã¯ãå¤å°èªå¼ãããã¾ããéã«è¨ãã¨GoogleDriveä¸ã§åä½ãããããã°ã©ã ã®å®è¡ç°å¢ã§ããä»åã¯åæ©çãªå©ç¨æ¹æ³ã«ã¤ãã¦ã¡ã¢ãã¦ããã¾ãã ç®æ¬¡1 ç¹å¾´2 æºå2.