2017-03-05 10 views
0
function onOpen() { 
    var ui = SpreadsheetApp.getUi(); 
    // Or DocumentApp or FormApp. 
    ui.createMenu('Useful Information') 
     .addItem('How do I Book?', 'menuItem1') 
     .addSeparator() 
     .addItem('Where do I Screenshot?', 'menuItem2') 
     .addSeperator() 
     .addItem('How do I Book?', 'menuItem1') 
     .addSeparator() 
} 

function menuItem1() { 
    var app = UiApp.createApplication().setHeight('60').setWidth('150'); 
    app.setTitle("Here is a helpful link to the guide"); 
    var panel = app.createPopupPanel() 
    var link = app.createAnchor('Click here! :D','http://prntscr.com/eg5x59'); 
    panel.add(link); 
    app.add(panel); 
    var doc = SpreadsheetApp.getActive(); 
    doc.show(app); 
} 

function menuItem2() { 
    var app = UiApp.createApplication().setHeight('60').setWidth('150'); 
    app.setTitle("Here is a link to the radio"); 
    var panel = app.createPopupPanel() 
    var link = app.createAnchor('Screenshot the red box using Lightshot','http://habboun.com/radio'); 
    panel.add(link); 
    app.add(panel); 
    var doc = SpreadsheetApp.getActive(); 
    doc.show(app); 
} 

function menuItem3() { 
    var app = UiApp.createApplication().setHeight('80').setWidth('150'); 
    app.setTitle("Here is a link to the DOR page"); 
    var panel = app.createPopupPanel() 
    var link = app.createAnchor('Post your Screenshot here on the most recent Special Task. Format is dd/mm/yy - HH:MM-HH:MM', 'http://habboun.com/content/department-radio'); 
    panel.add(link); 
    app.add(panel); 
    var doc = SpreadsheetApp.getActive(); 
    doc.show(app); 
} 

内でこのエラーにはわからないと私はそれを修正する方法を見当もつかない。私を助けてください。私はさまざまなフォーラムやすべてを見てきましたが、ソリューションのほとんどが特定のプロジェクトにあるため、解決策を見つけることができません。私はので、私はこのエラー<a href="http://prntscr.com/eg9ftl" rel="nofollow noreferrer">http://prntscr.com/eg9ftl</a> を受け付けておりますGoogleスプレッドシートスクリプトエディタ

+0

、UiAppは廃止されていて、使用すべきではないことに注意してください。.. ます。https://開発者。 google.com/apps-script/reference/ui/ui-app –

答えて

0

あなたが表示され、エラーが

TypeError: Cannot find function addSeperator in object Menu. 

"addSeperator" のスペルされて間違いです。 addSeparatorからaddSeparatorに変更してください。また、onOpen()には「addToUi」が必要です。だから、onOpen()のスクリプトは

ですから:

function onOpen() { 
    var ui = SpreadsheetApp.getUi(); 
    // Or DocumentApp or FormApp. 
    ui.createMenu('Useful Information') 
     .addItem('How do I Book?', 'menuItem1') 
     .addSeparator() 
     .addItem('Where do I Screenshot?', 'menuItem2') 
     .addSeperator() 
     .addItem('How do I Book?', 'menuItem1') 
     .addSeparator() 
} 

へ:また

function onOpen() { 
    var ui = SpreadsheetApp.getUi(); 
    // Or DocumentApp or FormApp. 
    ui.createMenu('Useful Information') 
     .addItem('How do I Book?', 'menuItem1') 
     .addSeparator() 
     .addItem('Where do I Screenshot?', 'menuItem2') 
     .addSeparator() 
     .addItem('How do I Book?', 'menuItem1') 
     .addSeparator() 
     .addToUi(); 
} 
関連する問題

 関連する問題