This script is for using with an OS X "folder action" created with "Automator", included with OS X.
It uses drive
(https://github.com/odeke-em/drive), and assumes it is installed and set up.
In this case, my "drive" has been initiated at ~/gdrive, and the subfolder Screenshots matches the same in my Google Drive.
- Use Automator to make a folder action to watch your screenshots folder, wherever that is.
- Paste the script in a "run shell script" action, selecting /bin/bash and "pass input as arguments".
- You can add a display notification if you like, that will popup an OS X notification when complete.
The script calls osascript
which allows you to do AppleScript functions from the terminal. It pops up a dialog to grab some text to be entered into the screenshot's description field on Google Drive. This text is indexed and you can search on it for recall later. You could also rename the file as well, using a similar technique.
If the script works, you'll see a rotating gear icon in the Mac toolbar (at least it's been like this through El Capitan), a publicly shared screenshot will appear in your Drive/Screenshots folder, and, you'll have the URL on the clipboard, ready for pasting.
Change screenshot file type:
defaults write com.apple.screencapture type png
Change screenshot file name:
defaults write com.apple.screencapture name "JRC Screenshot"
Restart the relevant service:
killall SystemUIServer
Confirm:
defaults read com.apple.screencapture
want to write me one?