2013-04-19 3 views
0

나는 비디오 게임 경제 추적자의 초기 단계에서 미래의 MMORPG에보다 나은 경제 역학을 구현하기 위해 노력하고있다. 먼저 Google 스프레드 시트를 만들어 가격을 추적하려고합니다. 여기에 Google Scripts의 코드 스 니펫이 있습니다. Google 스크립트에서는 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이 강제로 소화하도록하는 방법이 있습니까?

+1

http://stackoverflow.com/questions/12036726/how-to-add-formula-to-google-spreadsheet-google-apps-scripts 사용 – Ian

답변

0

체크 아웃 ...을
http://code.google.com/p/google-apps-script-issues/issues/detail?id=1592

이 기능을 사용할 수 없으며 사용할 수없는 것으로 보입니다. :(

당신은 텍스트 디스플레이 '자이언트 헤드'에 생략하고자하는 경우

, 작업 링크에 대한 당신이 할 수있는 최소한 반환 링크.

function makeLink(item) { 
    var encodedItem = encodeURI(underScore(toTitleCase(item))); 
    var wiki = "http://wiki.videogame_address.org/"; 
    wikiLink = wiki+encodedItem;  
    return wikiLink; 
}; 
관련 문제