This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetcher = async (query : string, variables?: any, headers?: any ) => await fetch(`/api/graphql`, { | |
method:'post', | |
headers: { | |
'Content-Type': 'application/json', | |
...headers | |
}, | |
body: JSON.stringify({ | |
query, | |
variables | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Here's sample with doGet | |
function doGet(e) { | |
//e is an Javascript object check it in GAS Guide to know its parameters | |
switch(e.parameter.functionName) { | |
case "Hello": | |
runHello() | |
break; | |
case "Cool": | |
runCool() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function importTable(URL,i) { | |
//Content | |
var resp=UrlFetchApp.fetch(URL).getContentText(); | |
//Regex | |
var regT=/<table[^>]*>([\s\S]*?)<\/table[^>]*>/g; | |
var regR=/<tr[^>]*>([\s\S]*?)<\/tr[^>]*>/g; | |
var regC=/<t[^>]*>([\s\S]*?)<\/t[^>]*>/g; | |
//Get All Tables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://gist.github.com/chemiadel/f1314bf8403eda071ca10c584947d1e7 | |
//Sheet Name | |
SHEET_NAME="Emails" | |
function sendEmails() { | |
//Assign Spreadsheet, Sheet to object variables | |
var ss=SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet=ss.getSheetByName(SHEET_NAME); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://gist.github.com/chemiadel/f2a023f2022ef6eafa86e7326bc92062 | |
RANGE="B5:F10"; | |
SHEET_NAME="Sheet1"; | |
//Types available : pdf,csv or xlsx | |
EXPORT_TYPE="pdf"; | |
function EmailRange() { | |
//Assign The Spreadsheet,Sheet,Range to variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://gist.github.com/chemiadel/bee4cb03481b580275d5296a3e7adc0d | |
function EmailPDF() { | |
//Get Active Spreadsheet | |
var spreadSheet=SpreadsheetApp.getActiveSpreadsheet(); | |
//Get All Sheets of the spreadsheets | |
var sheets=spreadSheet.getSheets(); | |
//Sheet wanted to export on PDF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function exportSpreadsheet() { | |
//All requests must include id in the path and a format parameter | |
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export | |
//FORMATS WITH NO ADDITIONAL OPTIONS | |
//format=xlsx //excel | |
//format=ods //Open Document Spreadsheet | |
//format=zip //html zipped | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub ReadPDF() | |
'NOTE: Adobe Acrobat Pro XI or higher has to be installed and the following references have to be active: | |
'Adobe Acrobat 10.0 Type Library (acrobat.tlb) Usually found in: C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\ | |
'Acrobat Access 3.0 Type Library (Accessibility.api) Usually found in: C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\plug_ins\ | |
'To check for active references, see Tools -> References OR use the Immediate window (ctrl + G) and type "for each r in references : debug.Print r.name, r.fullpath : next r" (minus "" quotes) | |
Dim AcroApp As Acrobat.CAcroApp 'We're going to use the Acrobat 'app', so point to that | |
Dim theForm As Acrobat.CAcroPDDoc 'Define that we're going to use a Acrobat Form (known as PDF) |