Tag Info

New answers tagged

1

Provision API has gone the way of the Dodo and now you have to rewrite your script and add some extra security approvals along the way. I got the info finally after a whole bunch of searching, after my script failed to day from here: http://thegapps.com/7/how-can-i-force-my-users-to-reset-the-password?show=8#a8 below is a summary (without the pretty ...


1

According to Authorization for Google Services it's not possible because for Standalone, add-on, or bound to Docs, Sheets, or Forms the script run as the user at keyboard. The alternatives is to convert your script to a web app or to a Installable trigger.


0

You could replace "CDI"&text(row(A:A),"000000") with text(month(now()),"00")&day(now())&year(now())&text(row(A:A),"000") but this would be the timestamp of now, not of when the cell was last updated. To capture the update time, you need a script. The script below runs every time the spreadsheet is edited, checks whether there are ...


1

In your code you wrote: var file = DriveApp.getFilesByName('test123.pdf') file is now an object containing all files with the name 'test123.pdf' The file in the object you want is file[0] In order to get the file you want, you can use MailApp.sendEmail(emailAddress, subject, message, { attachments: [file[0].getAs(MimeType.PDF)], })


3

DriveApp.getFilesByName() returns the file iterator. You therefore need to slightly modify the sendMail() arguments. MailApp.sendEmail(emailAddress, subject, message, {attachments: file.next().getBlob()} );


0

There's no way to obtain heading URLs, this is a popular but unsatisfied request. However, you can speed up your function by only looking into headings: function goto ( title ) { var doc = DocumentApp.getActiveDocument (), body = doc.getBody (), searchType = DocumentApp.ElementType.PARAGRAPH, searchResult = null, while ( searchResult ...


2

GmailApp works fine for consumer accounts, at least it did for my account few moments ago.


0

There are several add-ons for Google Documents and Sheets that already do that. One of them is Autocrat. Some of these add-ons work on "merge" model: a template and data source. The template holds the formatting, fixed text and placeholders for variable text. The spreadsheet is used as the data source, sometimes it has the menu options to trigger the merge ...


0

Building on Jacob’s answer, which I couldn’t edit: Use MM for the month (mm is for minutes). var curDate = Utilities.formatDate(new Date(), "GMT+1", "MM/dd/yyyy")


1

Worked with the above (works with all sheets), but made the following changes: Can handle absolute references Now prints to a draggable prompt so it doesn't write over notes -- function onOpen() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var menuEntries = [] menuEntries.push({name: "Trace Dependents", functionName: "traceDependents"}); ...


2

You can change the font-size in a Google Spreadsheet from 6 pt all the way up to 400 pt, just by typing in the size you want. When you click on the "Font size" icon drop-down you will notice the current size in the "input box" is highlighted in blue, you can type in that box the size you want and press Enter. A lot of programs has this feature but a lot of ...


1

See if this works: function onEdit(e) { var cols = [3, 4]; if (e.source.getActiveSheet().getName() !== 'my sheet' || cols.indexOf(e.range.columnStart) === -1) return; var t = Utilities.formatDate(new Date(), "GMT+02:00", "MM/dd/yyyy hh:mm:ss"); e.range.offset(0, 2).setValue(isFormula(e.source.getActiveSheet(), e.range.getA1Notation()) ? t : ...



Top 50 recent answers are included