如何解决“错误:请指定有效的电子表格网址。”

我正在使用库存的Google Apps脚本进行链接检查器(https://developers.google.com/google-ads/scripts/docs/solutions/link-checker#source-code)。我已经复制了模板电子表格以供参考,但是我一直得到答复“错误:请指定一个有效的电子表格URL。”

似乎是问题所在的代码部分是下面的第三行:

function validateAndGetSpreadsheet(spreadsheeturl) {
  if (spreadsheeturl == 'YOUR_SPREADSHEET_URL') {
    throw new Error('Please specify a valid Spreadsheet URL. You can find' +
        ' a link to a template in the associated guide for this script.');

我输入了我的URL来替换“ YOUR_SPREADSHEET_URL”,但是不确定我应该在

中输入什么
'Please specify a valid Spreadsheet URL. You can find' +
        ' a link to a template in the associated guide for this script.' 

我尝试将电子表格URL放在其中,也尝试将其省略,但均无效。我是Google Scripts的新手,所以将不胜感激!

zhenyuting 回答:如何解决“错误:请指定有效的电子表格网址。”

您需要在此处更改URL参数:

package main

import (
    "debug/pe"
    "fmt"
    "os"
)

// these constants are copied from https://github.com/golang/go/blob/6219b48e11f36329de801f62f18448bb4b1cd1a5/src/cmd/link/internal/ld/pe.go#L92-L93  
const (
    IMAGE_SUBSYSTEM_WINDOWS_GUI = 2
    IMAGE_SUBSYSTEM_WINDOWS_CUI = 3
)

func main() {
    fileName,err := os.Executable()
    if err != nil {
        panic(err)
    }
    fl,err := pe.Open(fileName)
    if err != nil {
        panic(err) // maybe not windows binary,or unreadable for some reasons
    }
    defer fl.Close()

    var subsystem uint16
    if header,ok := fl.OptionalHeader.(*pe.OptionalHeader64); ok {
        subsystem = header.Subsystem
    } else if header,ok := fl.OptionalHeader.(*pe.OptionalHeader32); ok {
        subsystem = header.Subsystem
    }

    if subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI {
        fmt.Println("it is windows GUI")
    } else if subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI {
        fmt.Println("it is windows CUI")
    } else {
        fmt.Println("binary type unknown")
    }
}
本文链接:https://www.f2er.com/3122707.html

大家都在问