How to remove all blank rows from one or more tables in a Google Docs document with Google Apps Script. You may also delete blank rows from tables in Google Slides.
Maximum runtimeĀ – in order to prevent the tool from reachingĀ the limits imposed by GoogleĀ you can adjust the number of minutes the tool can run for. Change this in the ‘GlobalVariables.gs’ file in the Script Editor.
Continue from where it left offĀ – if you have a lot of Google folders and files to handle and the above runtime is reached the tool will complete the current row/folder and prompt you to run it again, without duplicating any folders or files already created.
PopupsĀ – as well as the ‘Log’ sheet the tool displays a direct popup to the user if it encounters a problem.
Full naming controlĀ – you have the ability to tweak every single folder and file name that is created by the tool. See the Concatenate section below to understand the true power of this.
Clickable linksĀ – created by the tool which means you can navigate directly to the new folders and files directly from the Google Sheet.
Add more filesĀ – the tool currently has columns for 10 files to be added to each folder, but you can actually append more as long as you follow the same convention of 2 columns per file (1 file name and 1 file ID). Do this before you run the tool as you cannot add more files to a folder once it has been created.
Add more foldersĀ – after running the tool you can either choose to clear all of the data within it (use the ‘Reset sheets’ option from the ‘Admin’ menu) and start again or you can simply append further rows/folders and re-run without any duplication (if the ‘Folder Link’ column is not blank/empty then it will skip that row).
I use Google Apps Script to support staff and students in my job. I enjoy dabbling with creating tools to help with automation and I freely share my learning experiences on my blog, where I also have a number of useful Google Add-ons: www.pbainbridge.co.uk
Learn how to append a date-time stamp to list items, paragraphs and more in Google Docs with Google Apps Script
A very slick example from Scott ‘Yagi’ Donald which shows a very simple method for appending text at the current cursor position and all achieved in just over 50 lines of code, with comments. Head over to the source for the full code and explanation.
Bulk convert all the Google Docs within a given folder to PDFs and optionally delete the Docs afterwards. Specify the destination folder for the PDFs.
Bulk convert Google Docs to PDFs using Apps Script
The following Google Apps Script tool is designed to bulk convert all Google Docs within a given Google Drive folder into PDFs. You can choose the destination folder for the PDFs to be put into and also whether you want the original Docs to be deleted. This tool does work on Shared drives.
I use Google Apps Script to support staff and students in my job. I enjoy dabbling with creating tools to help with automation and I freely share my learning experiences on my blog, where I also have a number of useful Google Add-ons: www.pbainbridge.co.uk
With Google Apps Script, you can easily convert any HTML content into a PDF file. The converted PDF file can be either saved to a folder in your Google Drive, you can email the file as an attachment or the use the UrlFetchApp service of Apps Script to post the PDF file to an external service like Amazon S3 or Dropbox.
Bulk create Google Drive folders with optional files copied into each one. Also optionally add edit permissions to these folders/files.
Bulk create Google Drive folders and add files, from a Sheet of data
The following Google Apps Script tool was developed to bulk create Google Drive folders with optional files copied in to each one, all from data within a Google Sheet. There is also the option to add specific ‘edit’ permissions to the newly create Drive folders of which the files would automatically inherit this access level.
Key Functionality:
Complete the necessary information in the Config sheet before proceeding. Then use the Create folders option from the Admin menu at the top of the Google Sheet.
Adding permissions is optional – use the Config sheet to change the dropdown as required. If you select ‘No’ then the usual Google Drive inheritance will occur based on the parent Google Drive folder.
You can add multiple File IDs into the relevant cell and they can be different for each row. Leaving this cell blank/empty means no files will attempt to be copied into the new folder.
The original filename will be updated during the copy to append the folder name to the end of it, in order to prevent creating a large number of files with identical names.
There is a Log sheet to help troubleshoot any errors which may occur when running the tool.
I use Google Apps Script to support staff and students in my job. I enjoy dabbling with creating tools to help with automation and I freely share my learning experiences on my blog, where I also have a number of useful Google Add-ons: www.pbainbridge.co.uk
This is a quick discussion of how teacher can respond to student work using block based coding.
This is a very interesting prototype which makes it easier for users to visually develop Google Apps Script code. Developed by Stephen Callahan as part of a Google Innovator Project, TeacherBlocks lets to drag and drop blocks to design your code and automatically create the required script to copy/paste into your Google Doc. Watch the video to see it in action or visit the source link to try it yourself.
It is easy to search and replace text in Google Documents with the DocumentApp service of Google Apps Script. You can use use findText method with simple regular expressions to find text elements in the document that match a pattern and replace them with the specified text. All well and good but in some cases, this simple search and replace function may fail if the search text does not transform into a valid regular expression.
Some more regex goodness this time from Amit Agarwal who provides some very useful tips on escaping characters when using the DocumentApp service and findText method. Click through to the source link for more details.
The following Google Apps Script is designed to iterate through Google Docs in a given Google Drive folder and extract the paragraphs of text along with a link to each file into a Google Sheet. A new column will automatically be appended for each paragraph.
This tool was designed with the vision that you may wish to centrally collate some comments/feedback written by others in Docs, into one central location so you do not need to open each file in turn.
Provide a Google Folder ID to extract text from Docs
I use Google Apps Script to support staff and students in my job. I enjoy dabbling with creating tools to help with automation and I freely share my learning experiences on my blog, where I also have a number of useful Google Add-ons: www.pbainbridge.co.uk