구글 앱 스크립트

위키百科, 우리 모두의 百科事典.

앱 스크립트
開發者 구글
發表日 2009年 8月 19日 (14年 前) ( 2009-08-19 ) [1]
프로그래밍 言語 자바스크립트
種類 웹 프레임워크 , 스크립팅 프레임워크
웹사이트 script .google .com

앱 스크립트 (Apps Script)는 구글 워크스페이스 플랫폼에서 가벼운 애플리케이션 開發을 위해 구글 이 開發한 스크립팅 플랫폼이다. 구글 앱 스크립트는 처음에 마이크 函(Mike Harm)李 구글 시트의 開發者로서 일할 當時 副次的인 프로젝트로서 開發하였다. [2] 구글 앱 스크립트는 2009年 5月 베타 테스트 프로그램이 當時 구글 文書 製品 管理者 兆나란 로첼에 依해 發表되었을 때 처음 發表되었다. [3] 2009年 8月 구글 앱 스크립트는 모든 구글 앱 프리미어 및 에듀케이션 에디션 顧客들에게 利用이 可能해졌다. [4] 자바스크립트 1.6에 基盤을 두지만 ECMA스크립트 5 API의 下位 集合 및 1.7, 1.8의 一部도 包含한다. [5] 앱 스크립트 프로젝트는 구글 인프라의 서버 사이드 로 實行된다. 구글에 따르면 구글 스크립트는 구글 製品과 서드파티 서비스 간 태스크를 自動化하기 容易한 方法을 提供한다. [6] 앱 스크립트는 또한 구글 드라이브 龍 追加 機能을 提供하는 道具이기도 하다. [7]

例示 [ 編輯 ]

function
 doGet
(
e
)
 {

  var
 searchTerm
 =
 'Script Tools'

  var
 ui
 =
 XmlService
.
createDocument
(
XmlService
.
createElement
(
'html'
)).
setDocType
(
XmlService
.
createDocType
(
'html'
))

  var
 body
 =
 XmlService
.
createElement
(
'body'
)

  body
 =
 buildTree
(
body
,
 searchTerm
);

  ui
.
getRootElement
().
addContent
(
body
)

  return
 HtmlService
.
createHtmlOutput
(
XmlService
.
getRawFormat
().
format
(
ui
))

}



function
 buildTree
(
node
,
 searchTerm
)
 {

  var
 ul
 =
 XmlService
.
createElement
(
'ul'
).
addContent
(
XmlService
.
createElement
(
'p'
).
addContent
(
XmlService
.
createText
(
searchTerm
)));

  // Use of the Apps Script DriveApp Service to retrieve the collections.

  var
 folders
 =
 DriveApp
.
getFoldersByName
(
searchTerm
).
next
().
getFolders
()

  while
 (
folders
.
hasNext
()){

    var
 thisFolder
 =
 folders
.
next
();

    var
 li
 =
 XmlService
.
createElement
(
'li'
);

    var
 resp
 =
 buildTree
(
li
,
 thisFolder
.
getName
())

    ul
.
addContent
(
li
);

  }


  var
 files
 =
  DriveApp
.
getFoldersByName
(
searchTerm
).
next
().
getFiles
()

  while
 (
files
.
hasNext
())
 {

    var
 thisFile
 =
 files
.
next
()

    if
 (
thisFile
.
getMimeType
()
 ===
 "application/vnd.google-apps.document"
)
 {

      urlBase
 =
 "https://docs.google.com/document/edit?id="
;

      iconHTML
 =
 "https://drive-thirdparty.googleusercontent.com/32/type/application/vnd.google-apps.document"
;

    }

    else
 if
 (
thisFile
.
getMimeType
()
 ===
 "application/vnd.google-apps.spreadsheet"
)
 {

      urlBase
 =
 "https://spreadsheets.google.com/ccc?key="
;

      iconHTML
 =
 "https://drive-thirdparty.googleusercontent.com/32/type/application/vnd.google-apps.spreadsheet"
;

    }

    else
 if
 (
thisFile
.
getMimeType
()
 ===
 "application/vnd.google-apps.script"
)
 {

      urlBase
 =
 "https://docs.google.com/fileview?id="
;

      iconHTML
 =
 "https://drive-thirdparty.googleusercontent.com/32/type/application/vnd.google-apps.script"
;

    }

    else
 if
 (
thisFile
.
getMimeType
()
 ===
 "application/vnd.google-apps.presentation"
)
 {

      urlBase
 =
 "https://docs.google.com/present/edit?id="
;

      iconHTML
 =
 "https://drive-thirdparty.googleusercontent.com/32/type/application/vnd.google-apps.presentation"
;

    }

    else
 if
 (
thisFile
.
getMimeType
()
 ===
 "application/vnd.google-apps.drawing"
)
 {

      urlBase
 =
 "https://docs.google.com/drawings/edit?id="
;

      iconHTML
 =
 "https://drive-thirdparty.googleusercontent.com/32/type/application/vnd.google-apps.drawing"
;

    }

    else
 {

      urlBase
 =
 "https://docs.google.com/fileview?id="
;

      iconHTML
 =
 "https://drive-thirdparty.googleusercontent.com/32/type/application/application/vnd.google-apps.unknown"
;

    }


    var
 li
 =
 XmlService
.
createElement
(
'li'
);

    var
 image
 =
 XmlService
.
createElement
(
'img'
).
setAttribute
(
'src'
,
 iconHTML
);

    var
 fileLabel
 =
  XmlService
.
createElement
(
'a'
).
setAttribute
(
'href'
,
 urlBase
 +
 thisFile
.
getId
())

                      .
setAttribute
(
'target'
,
 '_blank'
).
addContent
(
XmlService
.
createText
(
thisFile
.
getName
()))

    var
 fileLabelPanel
 =
 XmlService
.
createElement
(
'div'
).
setAttribute
(
'style'
,
 'display:flex;flex-direction: row;'
)

    fileLabelPanel
.
addContent
(
image
)

    fileLabelPanel
.
addContent
(
fileLabel
)

    li
.
addContent
(
fileLabelPanel
)

    ul
.
addContent
(
li
)

  }

  node
.
addContent
(
ul
)

  return
 node
;

}

같이 보기 [ 編輯 ]

各州 [ 編輯 ]

  1. Meyer, David (2009年 8月 20日). “Google Apps Script gets green light” . 《CNet》. 2012年 8月 10日에 原本 文書 에서 保存된 文書 . 2011年 3月 26日에 確認함 .  
  2. Koleda, Eric (2019年 8月 21日). “Celebrating 10 years of Apps Script: looking back on how it started” . 《Google Cloud Blog》 . 2019年 8月 22日에 確認함 .  
  3. Rochelle, Jonathan (2009年 5月 27日). “Old tool, new tricks” . 《Google Cloud Blog》 . 2019年 8月 22日에 確認함 .  
  4. Levey, Evin (2009年 8月 19日). “Google Apps Script Launched to Google Apps Premier and Education” . 《Google Apps Script》 . 2019年 8月 22日에 確認함 .  
  5. Kienle, Holger (May?June 2010). “It's About Time to Take JavaScript (More) Seriously” . 《IEEE Software》 27 (3): 60?62. doi : 10.1109/MS.2010.76 . 2010年 6月 29日에 原本 文書 에서 保存된 文書 . 2011年 3月 25日에 確認함 .  
  6. Google Apps Script
  7. Bring a little something extra to Docs and Sheets with add-ons

外部 링크 [ 編輯 ]