Convert a Markdown text file into a Google Document using Appscript?

One suggestion: use Pandoc to convert Markdown to docx, then import to Google Docs using the Google Drive API. You can also accomplish this using the Google Drive web interface: Convert markdown to ODT (or some other intermediate) using pandoc: pandoc MyFile.md -f markdown -t odt -s -o MyFile.odt Move the ODT file into your … Read more

Get Google Sheet by ID?

You can use something like this : function getSheetById(id) { return SpreadsheetApp.getActive().getSheets().filter( function(s) {return s.getSheetId() === id;} )[0]; } var sheet = getSheetById(123456789); And then to find the sheet ID to use for the active sheet, run this and check the Logs or use the debugger. function getActiveSheetId(){ var id = SpreadsheetApp.getActiveSheet().getSheetId(); Logger.log(id.toString()); return id; … Read more

Easiest way to get file ID from URL on Google Apps Script

DriveApp is indeed missing a getFileByUrl (and also folder for that matter). You may want to open an enhancement request on Apps Script issue tracker. But what I do on my scripts (since these openByUrl functions are somewhat new), is to get the id using a regex. Like this. function getIdFromUrl(url) { return url.match(/[-\w]{25,}/); } … Read more

Find Cell Matching Value And Return Rownumber

Here the code function rowOfEmployee(){ var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var data = sheet.getDataRange().getValues(); var employeeName = sheet.getRange(“C2”).getValue(); for(var i = 0; i<data.length;i++){ if(data[i][1] == employeeName){ //[1] because column B Logger.log((i+1)) return i+1; } } } When you want to perform this kind of lookup it is better to retrieve data with sheet.getDataRange().getValues() because in this … Read more