Google apps script 在输入消息中使用超链接

Google apps script 在输入消息中使用超链接,google-apps-script,google-sheets,Google Apps Script,Google Sheets,在我当前的电子表格中,当您输入某个值时,将显示一条输入消息。但是,输入消息中应该有一个链接,可以将您带到另一个选项卡 以下是我目前掌握的代码: if (cellSheet !== sheet && cellColumn === 4) { if (cellValue === "PT1 - Induction Training") { Browser.msgBox("PT1 - Induction Training: This is a Theory Based course

在我当前的电子表格中,当您输入某个值时,将显示一条输入消息。但是,输入消息中应该有一个链接,可以将您带到另一个选项卡

以下是我目前掌握的代码:

 if (cellSheet !== sheet && cellColumn === 4) {
if (cellValue === "PT1 - Induction Training") {
  Browser.msgBox("PT1 - Induction Training: This is a Theory Based course and does not require you to be on the server. It should take 15-20 minutes.)");  //Add the course name and the message that I want to popup. Course name should be exactly the same as in the list (case sensitive)
} 

else if (cellValue === "PT2 - Traffic & Communications - Part 1") {
  Browser.msgBox("PT2 - Traffic & Communications - Part 1 - Starting a Patrol: This is a Practical Based course and does require you to be on the server. It should take 10-15 minutes. The manual for this course can be viewed here: https://docs.google.com/document/d/1EUAtzKHaDXGMJLcGy5usXiHE7QU7B7g98OSUuKd94ss/edit");  //// add as many "else if" conditions as you want"
} else if (cellValue === "PT2 - Traffic & Communications - Part 2") {
  Browser.msgBox("PT2 - Traffic & Communications - Part 2 - Traffic Stops: This is a Practical Based course and does require you to be on the server. It should take 10-15 minutes. The manual for this course can be viewed here: https://docs.google.com/document/d/1EUAtzKHaDXGMJLcGy5usXiHE7QU7B7g98OSUuKd94ss/edit");   
} else if (cellValue === "PT2 - Traffic & Communications - Part 3") {
  Browser.msgBox("PT2 - Traffic & Communications - Part 3 - Checkpoints: This is a Practical Based course and does require you to be on the server. On average, it takes around an HOUR to do, so please bare in mind if you are able to do it. The manual for this course can be viewed here: https://docs.google.com/document/d/1EUAtzKHaDXGMJLcGy5usXiHE7QU7B7g98OSUuKd94ss/edit");   
} else if (cellValue === "PT2 - Traffic & Communications - Part 4") {
  Browser.msgBox("PT2 - Traffic & Communications - Part 4 - Basic Communication: This is a Theory Based course and does not require you to be on the server. It should take 10-15 minutes. The manual for this course can be viewed here: https://docs.google.com/document/d/1EUAtzKHaDXGMJLcGy5usXiHE7QU7B7g98OSUuKd94ss/edit");   
} else if (cellValue === "PT2 - Traffic & Communications - Part 5") {
  Browser.msgBox("PT2 - Traffic & Communications - Part 5 - Communication with Officers: This is a Theory Based course and does not require you to be on the server. It should take 10-15 minutes.The manual for this course can be viewed here: https://docs.google.com/document/d/1EUAtzKHaDXGMJLcGy5usXiHE7QU7B7g98OSUuKd94ss/edit");   
} else if (cellValue === "PT3 - Officer Advancement - Part 1") {
  Browser.msgBox("PT3 - Officer Advancement - Part 1: This is a Theory Based course and does not require you to be on the server. It should take 25-30 minutes.");   
} else if (cellValue === "PT3 - Officer Advancement - Part 2") {
  Browser.msgBox("PT3 - Officer Advancement - Part 2: This is a Practical Based course and does require you to be on the server. On average, it takes around an HOUR to do, so please bare in mind if you are able to do it.");   
} else if (cellValue === "PT4 - Air Support ") {
  Browser.msgBox("PT4 - Air Support: This is a Practical Based course and does require you to be on the server. It should take around 30-40 minutes");   
} else if (cellValue === "PT5 - Interceptors") {
  Browser.msgBox("PT5 - Interceptors: This is a Practical Based course and does require you to be on the server. It should take around 40-50 minutes");   
} 


  else if (cellValue === undefined) {  }
else {
  Browser.msgBox("You have entered an invalid course, please select a correct course.");   //This is in case they put a wrong course name
}
}
}
链接所在的位置,在消息的末尾,例如:“可以在此处查看手册:”,我希望它们形成一个超链接,因此当单击时,会将您带到该手册

以下是电子表格的链接:

非常感谢,


Shaun.

您似乎正在使用,这将不允许您添加链接

相反,我认为您希望创建一个允许您为对话框创建HTML的标签,允许您为链接使用标签

注意:我已经有一段时间没有检查了,但我认为应用程序脚本会在用户单击这样的链接时向用户显示警告