你可以在通过 clasp 推送之前设置 AppScript 项目的 ScriptProperty 值吗?

huangapple go评论60阅读模式
英文:

Can you set a value in the ScriptProperty of a AppScript Project before pushing via clasp?

问题

I would like to set a value programmatically in the ScriptProperty before I push it via clasp but I could not find a way to do it.

I also could not find any API to set it from outside.

英文:

I would like to set a value programmatically in the ScriptProperty before I push it via clasp but I could not find a way to do it.

I also could not find any API to set it from outside.

答案1

得分: 1

抱歉,我只提供代码部分的翻译:

"I'm afraid this is not possible. The Google Apps Script API does not support managing or retrieving information from script properties yet, therefore when using the API you won't be able to see that info.

Because of that when cloning projects using clasp the result is the same, that information will not appear anywhere, hence it can't be managed.

The only available option so far to manage this information is using the setProperties() method from the Properties class from Apps Script itself, but they can't be managed locally before being pushed with clasp in case your end goal was to push changes to the project including all the properties values. The only way is to push the changes to the script and then push the update to the values.

I would still consider this a good idea. I would recommend posting this as a feature request in the Google's issue tracker to see if they can make it possible in the near future.

References:

英文:

I'm afraid this is not possible. The Google Apps Script API does not support managing or retrieving information from script properties yet, therefore when using the API you won't be able to see that info.

Because of that when cloning projects using clasp the result is the same, that information will not appear anywhere, hence it can't be managed.

The only available option so far to manage this information is using the setProperties() method from the Properties class from Apps Script itself, but they can't be managed locally before being pushed with clasp in case your end goal was to push changes to the project including all the properties values. The only way is to push the changes to the script and then push the update to the values.

I would still consider this a good idea. I would recommend posting this as a feature request in the Google's issue tracker to see if they can make it possible in the near future.

References:

huangapple
  • 本文由 发表于 2023年5月11日 17:20:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76226044.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定