我正在开发视频游戏经济跟踪器的早期阶段,以最终将更好的经济动态应用到未来的 MMORPG 中。所以,首先我试图创建一个谷歌电子表格来跟踪价格,这是谷歌脚本中的相关代码片段。据我所知,Google Scripts 使用与JavaScript完全相同的功能。
function makeLink(item) {
  var encodedItem = encodeURI(underScore(toTitleCase(item)));
  //make spaces into underscores, then URL-encode the rest
  var wiki = "http://wiki.videogame_address.org/"; 
  //the base wiki URL for the video game
  wikiLink = wiki+encodedItem;
  //link to the item in the wiki      
  var href = "=HYPERLINK(\""+wikiLink+"\",\""+toTitleCase(item)+"\")";
  //attempting to have Google Spreadsheet make a URL
  //yields =HYPERLINK("http://wiki.videgame.org/Giant_Head","Giant Head")
  return href;
};
生成的 href 变量仅给出文本输出
=HYPERLINK("http://wiki.videgame.org/Giant_Head","Giant Head")
这是电子表格创建链接的正确语法,但是,它只是将其保留为文本。有没有办法强制谷歌消化这里输出的文本而不是将其作为文本保留?