ボタンを作成し、そのボタンにマクロ (機能) を割り当てるか、Google スプレッドシートで新しいメニュー項目を簡単に作成できます。新しいメニュー項目は、カスタム関数を使用してプログラムで実現され、スプレッドシートの onOpen トリガーを使用して実行されます。
function onOpen(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [ {name: "Text File Upload", functionName: "text_file_upload"},
{name: "Change Name", functionName: "change_name"},
{name: "TextFile to S.sheet", functionName: "t_file_ssheet"} ];
ss.addMenu("Text Files", menuEntries);
} //this onOpen function will add a new menu to your spreadsheet called "Text Files" with 3 submenu items you can use to work with your text files.
function text_file_upload() {
Browser.msgBox("You are about to upload new text file");
//insert code here to get textfile location/Url and Textfile Data, this can be stored in array
}
function change_name() {
var newName = Browser.inputBox("Enter the new name for the text file:");
//insert code here to assign new file name to the text file
}
function t_file_ssheet(){
//insert code here to copy data from your textfile to a sheet in your spreadsheet
}
ここには非常に優れたチュートリアルがあり、探しているコーディングのほとんどをカバーしています。