我的脚本“从Google文档获取URL”不再起作用-服务器故障为什么?

时间:2019-08-01 09:28:55

标签: google-apps-script

通常,我想在文本字段中打印实际使用的google文档的网址。

如果我复制Google工作表,该功能也应适用于新文档。

我编写了一个可以使用20个月的解决方案,现在遇到了问题。

现在我想知道会发生什么?为什么我有服务器问题?服务器是否可能出现许多Google文档(我有〜9000-它作为小型ERP系统)?

Google工作表中的公式:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

  <xsl:output indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:key name="trans-group"
    match="transaction" use="number"/>

    <xsl:template match="@* | node()">
       <xsl:copy>
          <xsl:apply-templates select="@* | node()"/>
       </xsl:copy>
    </xsl:template>

  <xsl:template match="transactions">
      <xsl:copy>
          <xsl:for-each select="transaction[generate-id() = generate-id(key('trans-group', number)[1])]">
              <xsl:apply-templates select="key('trans-group', number)"/>
          </xsl:for-each>
      </xsl:copy>
  </xsl:template>

  <xsl:template match="transaction">
      <xsl:copy>
          <xsl:apply-templates select="@* | node()"/>
          <line>
              <xsl:value-of select="position()"/>
          </line>
      </xsl:copy>
  </xsl:template>

</xsl:stylesheet>

脚本编辑器中的代码:

=hyperlink(getSheetUrl()

这是我的文档中的错误消息:

  

错误:发生服务器错误。请尝试再次保存项目。 (行0)。

  • 如果我尝试将项目保存在脚本编辑器中,我不会失败。

  • 如果我尝试在脚本编辑器中运行项目,则会得到:

      

    发生服务器错误。请尝试再次保存该项目。

1 个答案:

答案 0 :(得分:0)

感谢您的回答。

今天我启动了系统,一切正常。

昨天,我还能够在新环境中运行代码,但是我无法复制现有文档。那里我失败了。

也许是因为局域网连接很弱。 我的公司很偏僻;)

我会注意的,

顺便说一句。 有谁知道如何从文档中获取链接并将其打印在同一文档的文本字段中(希望您知道我的意思)