简体   繁体   English

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

[英]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. 好吧,第一个优点是您不需要安装Java或Eclipse或任何其他库。 With any modern browser that you already use to access the Spreadsheet, you may write Apps Script code. 使用已经用于访问电子表格的任何现代浏览器,您都可以编写Apps脚本代码。

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. 其次,您无需担心身份验证,即客户端登录,AuthSub,oAuth,oAuth2等。AppsScript为您无缝处理身份验证过程。

Apps Script also have a "tighter" integration with Google Spreadsheets (and Documents). Apps Script还与Google Spreadsheets(和文档)具有“更紧密的”集成。 It has many features that are not available on the regular Spreadsheet API. 它具有许多常规电子表格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. 从电子表格上的自定义菜单或“图像按钮”运行时,Apps Script可以向电子表格上的任何用户显示漂亮的自定义UI。

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). 还有一些方法可以将格式应用于电子表格单元格,合并/取消合并单元格,设置前行和列形,保护工作表,添加图表,图像等(我认为Spreadsheet API v3中没有这些功能,但是我可能错了)。

Apps Script runs on the cloud and does not depend on your computer or any installation process. Apps脚本在云上运行,并且不依赖于您的计算机或任何安装过程。 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. Apps Script比Java简单得多,具有多个库和版本,类路径和IDE的设置。 Anyone can start using it, does not require a skilled developer to set it up, any savvy user is up for the task. 任何人都可以开始使用它,不需要熟练的开发人员来设置它,任何精明的用户都可以完成任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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