-
-
Save dmadisetti/d21d292f69fbec6a9499 to your computer and use it in GitHub Desktop.
Google Docs Hack
This file contains 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
#!/bin/sh | |
# Short script to auto format on save | |
MATCHING=false; | |
press(){ | |
xte "$1"; | |
if [ "x" = "$2x" ]; then | |
sleep 0.05; | |
else | |
sleep 0.2; | |
fi | |
} | |
run(){ | |
MATCHING=false; | |
# Select all | |
press "keydown Control_R" x; | |
press "key a"; | |
press "keyup Control_R"; | |
# Tools->Addons->Code->Selection->Enter | |
press "keydown Alt_R" x; | |
press "key b"; | |
press "keyup Alt_R"; | |
press "key Right"; | |
press "key Down"; | |
press "key Right"; | |
press "key Return"; | |
} | |
prime(){ | |
MATCHING=true; | |
} | |
match(){ | |
while read line; do | |
if [ "$MATCHING" = true ] ; then | |
echo $line | grep "press 39" && run; # S press | |
else | |
MATCHING=false; | |
echo $line | grep "press 37" && prime; # Ctrl press | |
fi | |
done | |
} | |
xinput test $1 | match; |
From the shortcut list
press "keydown Alt_R" x;
press "key b";
Should now be
press "keydown Alt_R" x;
press "key n";
to pop the addons menu
Hi! So im a lead general and co-owner of this major google doc called glicthquake, and we are currently at war against glitch wires, another doc, im wondering what this hack does, and if it gives ownership/edit on documents.
No, but you could extend it to do that. This just applied a plugin for formatting code in a Google doc. I made it when I went through Google interviews (code questions in a doc are pretty dumb)
Ty, but the war is over. LOL
is this supposed to be a bookmarklet?
It's a bash script to emulate keypresses and run a google docs plugin on a certain key strokes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ILikeCheating Maybe an older version of google docs?
You did need the code pretty print plugin, which is now blocked.
Maybe using code-blocks it'll work? https://workspace.google.com/marketplace/app/code_blocks/100740430168
This script works by navigating the tool menu and auto selecting format code, so adapt it for whatever menu options you have