Skip to content

Instantly share code, notes, and snippets.

/*
Create menu item to run script from spreadsheet.
*/
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Create Doc')
.addItem('Create Doc', 'getSpreadsheetData')
.addToUi();
init by gas-hub, just delete this file.
@michaelos02
michaelos02 / pagecountWork.gs
Created November 30, 2019 20:29
Counting Pages in Google Doc - can't be done BUT if you make it a PDF you can. Here is link: https://stackoverflow.com/questions/36432487/how-to-get-the-number-of-pages-in-google-docs-via-google-script
function getNumPages() {
var blob = DocumentApp.getActiveDocument().getAs("application/pdf");
var data = blob.getDataAsString();
var pages = parseInt(data.match(/ \/N (\d+) /)[1], 10);
Logger.log("pages = " + pages);
return pages;
}
@michaelos02
michaelos02 / index.html
Created March 28, 2019 14:57
Tutoairla
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="trans">What?</div>