Hyperlink 在msgbx/toast中显示多个超链接。。。?

Hyperlink 在msgbx/toast中显示多个超链接。。。?,hyperlink,google-apps-script,messagebox,toast,Hyperlink,Google Apps Script,Messagebox,Toast,所以基本上我有一个链接列表,我想让用户通过某种弹出窗口看到。我发现了一个类似的问题,解决方案是制作一个UI面板来实现这一点。但这只是一个环节。我需要把在同一个地区的多个链接一个接一个。当我尝试对多个链接执行此操作时,它显示了一个错误,即每个家长只允许一个孩子或类似的内容 我希望有人能把我推向正确的方向。难道真的不可能在消息框或祝酒词中加入超链接吗 提前感谢。正如Srik评论的那样,使用不同的面板,例如: function test(){ showURL('Google','http://www.

所以基本上我有一个链接列表,我想让用户通过某种弹出窗口看到。我发现了一个类似的问题,解决方案是制作一个UI面板来实现这一点。但这只是一个环节。我需要把在同一个地区的多个链接一个接一个。当我尝试对多个链接执行此操作时,它显示了一个错误,即每个家长只允许一个孩子或类似的内容

我希望有人能把我推向正确的方向。难道真的不可能在消息框或祝酒词中加入超链接吗


提前感谢。

正如Srik评论的那样,使用不同的面板,例如:

function test(){
showURL('Google','http://www.google.com','Stackoverflow','http://stackoverflow.com/questions/tagged/google-apps-script')
}

function showURL(name1,href1,name2,href2){ // for ease of use I give the urls as parameters but you could define these urls in the function as well
  var app = UiApp.createApplication().setHeight(60).setWidth(200);
  app.setTitle("Show URLs");
  var link1 = app.createAnchor(name1, href1);
  var link2 = app.createAnchor(name2, href2);

  app.add(app.createVerticalPanel().add(link1).add(link2));  // add others as needed
  var doc = SpreadsheetApp.getActive();
  doc.show(app);
  }


编辑:感谢您的接受-如果您需要它是动态的,请尝试以下操作,使用数组作为参数:

function test(){
showURL(['Google','http://www.google.com','Stackoverflow','http://stackoverflow.com/questions/tagged/google-apps-script','Google','http://www.google.com','Stackoverflow','http://stackoverflow.com/questions/tagged/google-apps-script'])
}

function showURL(data){ // for ease of use I give the urls as parameters but you could define these urls in the function as well
  var app = UiApp.createApplication().setHeight(40+8*data.length).setWidth(200);
  app.setTitle("Show URLs");
  var panel = app.createVerticalPanel();
  app.add(panel);
  for(var d=0 ; d<data.length;d=d+2){
  var link = app.createAnchor(data[d], data[(d+1)]);
  panel.add(link);
  }
  var doc = SpreadsheetApp.getActive();
  doc.show(app);
  }
功能测试(){
showURL(['Google','http://www.google.com'、'Stackoverflow'、'http://stackoverflow.com/questions/tagged/google-apps-script","谷歌",http://www.google.com'、'Stackoverflow'、'http://stackoverflow.com/questions/tagged/google-apps-script'])
}
函数showURL(data){//为了便于使用,我将URL作为参数提供,但您也可以在函数中定义这些URL
var app=UiApp.createApplication().setHeight(40+8*data.length).setWidth(200);
app.setTitle(“显示URL”);
var panel=app.createVerticalPanel();
应用程序添加(面板);

对于Srik评论的(var d=0;d),请使用以下不同的面板:

function test(){
showURL('Google','http://www.google.com','Stackoverflow','http://stackoverflow.com/questions/tagged/google-apps-script')
}

function showURL(name1,href1,name2,href2){ // for ease of use I give the urls as parameters but you could define these urls in the function as well
  var app = UiApp.createApplication().setHeight(60).setWidth(200);
  app.setTitle("Show URLs");
  var link1 = app.createAnchor(name1, href1);
  var link2 = app.createAnchor(name2, href2);

  app.add(app.createVerticalPanel().add(link1).add(link2));  // add others as needed
  var doc = SpreadsheetApp.getActive();
  doc.show(app);
  }


编辑:感谢您的接受-如果您需要它是动态的,请尝试以下操作,使用数组作为参数:

function test(){
showURL(['Google','http://www.google.com','Stackoverflow','http://stackoverflow.com/questions/tagged/google-apps-script','Google','http://www.google.com','Stackoverflow','http://stackoverflow.com/questions/tagged/google-apps-script'])
}

function showURL(data){ // for ease of use I give the urls as parameters but you could define these urls in the function as well
  var app = UiApp.createApplication().setHeight(40+8*data.length).setWidth(200);
  app.setTitle("Show URLs");
  var panel = app.createVerticalPanel();
  app.add(panel);
  for(var d=0 ; d<data.length;d=d+2){
  var link = app.createAnchor(data[d], data[(d+1)]);
  panel.add(link);
  }
  var doc = SpreadsheetApp.getActive();
  doc.show(app);
  }
功能测试(){
showURL(['Google','http://www.google.com'、'Stackoverflow'、'http://stackoverflow.com/questions/tagged/google-apps-script","谷歌",http://www.google.com'、'Stackoverflow'、'http://stackoverflow.com/questions/tagged/google-apps-script'])
}
函数showURL(data){//为了便于使用,我将URL作为参数提供,但您也可以在函数中定义这些URL
var app=UiApp.createApplication().setHeight(40+8*data.length).setWidth(200);
app.setTitle(“显示URL”);
var panel=app.createVerticalPanel();
应用程序添加(面板);

对于(var d=0;d使用正确类型的面板,您可以添加多个链接。您可以在此处发布您的代码吗?也可以尝试使用不同的面板,垂直面板可能只发布与我上面发布的链接略有不同的代码。但是您和Serge回答了我的问题。谢谢!使用正确类型的面板,您可以添加多个链接。可以吗你在这里发布你的代码。同时尝试使用不同的面板,垂直面板可能只是发布了我上面发布的链接的代码的一个微小变化。但是你和Serge回答了我的问题。谢谢!谢谢Serge!这将我推向了正确的方向。我有一个动态链接列表,但使用上面的代码并不难o根本不需要实现。我只是需要这样的东西来运行。非常感谢!我已经开始调整您的原始代码以使用动态列表。但是您的新代码比我的代码更高效。谢谢!:)我的荣幸:-),有很多方法可以让它工作…,使用数组可能是最简单的方法之一。对象也会很好…谢谢Serge!这将我推向了正确的方向。我有一个动态链接列表,但使用上面的代码并不难实现。我只需要这样的东西来运行。非常感谢!我已经开始调整您的原始代码以使用动态列表。但是您的新代码比我的代码更高效。谢谢!:)我的荣幸:-),有很多方法可以让它工作…,使用数组可能是最简单的方法之一。对象也会很好。。。