【发布时间】:2013-04-13 02:03:19
【问题描述】:
我正在开发视频游戏经济跟踪器的早期阶段,以最终在未来的 MMORPG 中实现更好的经济动态。因此,首先我尝试创建一个 Google 电子表格来跟踪价格,这是 Google Scripts 中相关的 sn-p 代码。据我所知,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")
这是电子表格创建链接的正确语法,但是,它只是将其保留为文本。有没有办法强制 Google 消化此处输出的文本,而不是将其保留为文本?
【问题讨论】:
标签: javascript google-apps-script google-sheets