Google Apps Script editor keyboard shortcuts
I've compiled a comprehensive list of keyboard shortcuts for the Google Apps Script editor to help you become more productive while using it.
Note
These shortcuts are for the legacy Apps Script code editor. If you see a blue "Use new editor" button, then you are using the legacy code editor and the shortcuts in this article will work.
On the other hand, if you're using the new code editor (screenshot below), the keyboard shortcuts in this article will NOT work.
1. Save your script
To save your script, use the following keyboard shortcut:
CTRL + S (
On a Mac it is ⌘ S
)
2. Run your script
To run your script, use the following keyboard shortcut:
CTRL + R
(On a Mac it is ⌘ R
)
🛈 When you run your script, the function that is selected in the toolbar will be run. The screenshot below shows the function example1 selected. This is the function that will be run.
3. View logs
To view logs, use the following keyboard shortcut:
CTRL + ENTER
(On a Mac it is ⌘ ENTER
)
4. Toggle comments
To toggle comments, first select the lines you want to comment or uncomment and then use the following keyboard shortcut:
CTRL + /
(On a Mac it is ⌘ /
)
5. Indent your code
To indent your code, use the following keyboard shortcut if auto-indenting is ON:
TAB
Use this other keyboard shortcut if auto-indenting is OFF:
SHIFT + TAB
🛈 How to find out if auto-indenting is ON or OFF?
If the auto-indent button on the toolbar is pressed, auto-indenting is ON.
Otherwise it is OFF.
6. Select all
To select all, use the following keyboard shortcut:
CTRL + A
(On a Mac it is ⌘ A
)
7. Bring up the auto-complete dialog
To auto-complete core functionality such as classes and methods in Apps Script, use the following keyboard shortcut (note: in Apps Script, this feature is called content assist):
CTRL + SPACE
(On a Mac it is ⌘ SPACE
)
To auto-complete the names of variables or functions that you've defined, use the following keyboard shortcut (note: this shortcut only works after you type at least one letter):
ALT + /
8. Undo change
To undo your most recent change, use the following keyboard shortcut:
CTRL + Z
(On a Mac it is ⌘ Z
)
9. Redo change
To redo your most recent change, use the following keyboard shortcut:
CTRL + Y
(On a Mac it is ⌘ Y
)
10. Find and replace
To find and replace text in your code, use the following keyboard shortcut:
CTRL + F
(On a Mac it is ⌘ F
)
★ How to move the Find and replace dialog to the side so it does not hide the code behind it?
The Find and replace dialog window often hides the code behind it. This makes it hard for you to see the occurrences of the text that you're trying hidden from view by the dialog. You can move the dialog to the side by grabbing (clicking on and keeping the mouse pressed) the "Find and replace" title and then moving your mouse to one side of your screen. The dialog will move with your mouse.