简体   繁体   中英

What are advantages of using Google Apps Script to interact with Google Sheets over using regular Java code in Eclipse?

与在Eclipse中使用常规Java代码相比,使用Google Apps脚本与Google表格进行交互有什么优势?

Well, the first advantage is that you don't need to install Java or Eclipse or any other library. With any modern browser that you already use to access the Spreadsheet, you may write Apps Script code.

Second, you don't need to worry with authentication, ie Client Login, AuthSub, oAuth, oAuth2, etc. Apps Script handles the authentication process seamless for you.

Apps Script also have a "tighter" integration with Google Spreadsheets (and Documents). It has many features that are not available on the regular Spreadsheet API. For example, it can add menus to the Spreadsheet interface, set up triggers to run the script whenever a cell is edited or a form is submitted. When running from a custom menu or an "image button" on the spreadsheet, Apps Script can show nice custom UIs to any user on the spreadsheet.

There's also methods to apply formatting to spreadsheet cells, merge/unmerge cells, set fronzen rows and columns, protect sheets, add charts, images, etc (which I think are not present on the Spreadsheet API v3, but I might be wrong).

Apps Script runs on the cloud and does not depend on your computer or any installation process. Once you've setup a script to interact with a spreadsheet (via menus or triggers), any user that edit that spreadsheet can interact with the script. There's no need to install anything else and your computer can be off.

Apps Script is much easier than Java, with multiple libraries and versions, classpaths and IDE's setup. Anyone can start using it, does not require a skilled developer to set it up, any savvy user is up for the task.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM