Keyboard Shortcuts for Google Apps Script Editor

Keyboard Shortcuts for Google Apps Script Editor

Google Apps Script is a powerful tool for automating tasks across Google Suite products, including Google Sheets, Docs, and Forms. To enhance your coding efficiency in the Apps Script Editor, mastering a set of keyboard shortcuts is essential. In this post, we’ll cover some of the most useful shortcuts that can speed up your scripting workflow.

Basic Navigation and Editing

  • Ctrl + Space (Cmd + Space on Mac): Trigger autocomplete to suggest methods, variables, and more.
  • Ctrl + Enter (Cmd + Enter on Mac): Execute the function where the cursor is located.
  • Ctrl + / (Cmd + / on Mac): Toggle commenting on the selected line or lines.
  • Ctrl + S (Cmd + S on Mac): Save your script.

Text Manipulation

  • Ctrl + D (Cmd + D on Mac): Select the next occurrence of the selected word. Repeat to select multiple instances.
  • Ctrl + Shift + K (Cmd + Shift + K on Mac): Delete the current line without copying it.
  • Alt + Up/Down (Option + Up/Down on Mac): Move the current line up or down.
  • Ctrl + Shift + [ or ] (Cmd + Shift + [** or ] on Mac): Fold (collapse) or unfold (expand) the code block.

Navigating Code

  • Ctrl + G (Cmd + G on Mac): Jump to a specific line number.
  • Ctrl + P (Cmd + P on Mac): Open the “Go to File” dialog to quickly switch between files in your project.
  • Alt + Left/Right (Option + Left/Right on Mac): Navigate backward or forward through your code’s location history.

Running and Debugging

  • Ctrl + , (Cmd + , on Mac): Open the project’s settings.
  • F9: Set or unset a breakpoint on the current line.
  • Ctrl + F8 (Cmd + F8 on Mac): Toggle enabling or disabling all breakpoints.

Enhancing Your Workflow

Utilizing these shortcuts in the Apps Script Editor can greatly enhance your productivity and make your script development smoother and faster. Over time, these keystrokes will become second nature, allowing you to focus more on creating effective scripts rather than navigating the interface.

For additional shortcuts and tips, always refer to the latest updates in the Apps Script documentation or explore community forums for insights and best practices. Happy scripting!