将当前的Google脚本名称获取为变量 [英] Get Current Google Script Name to a Variable

查看:49
本文介绍了将当前的Google脚本名称获取为变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道一种方法来获取绑定到您正在使用的工作表的当前Google脚本文件的名称,并将其写入变量吗?我想将其放在工作表单元格中,以跟踪所做的更改.

Does anyone know a way to get the name of the current google script file that's bound to the sheet you are using and write it to a variable? I want to put it into a sheets cell to keep track of changes I make.

欢呼

推荐答案

var id = ScriptApp.getScriptId();
var name = DriveApp.getFileById(id).getName();
Logger.log(name);

这篇关于将当前的Google脚本名称获取为变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆