Created
August 27, 2014 09:46
-
-
Save cristianca/716dd73028b6abfd9b9d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// insert text at cursor position in a Google Docs using apps script. | |
function insertTextAtCursorPosition(text) { | |
var doc = DocumentApp.getActiveDocument(); | |
var cursor = doc.getCursor(); | |
if (cursor) { | |
text = cursor.insertText(text); | |
position = doc.newPosition(text, text.getText().length); | |
doc.setCursor(position); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment