I need to paste sequential rectangular selections from a PNG opened in Preview into a designated Google Doc. I suspect AppleScript is the best candidate for this, but I'm open to using a more familiar language like Python or JS. Here's some rough pseudocode for what I want to do.
Define Hot Keys for CopyPaste and Done
File Dialog to select destination Google Doc
Open destination doc
Set insertion point at end of destination doc
Until Done key pressed:
Activate Preview window
On CopyPaste key pressed:
Copy current selection from Preview
Paste to destination doc
Insert two newlines
The goal is speed up the many copy/paste operations that I'm now doing by Cmd-C, click destination window, Cmd-V, Enter, Enter, click Preview (so I can make the next selection).
Best Answer
The following is working for me in OS X 10.9:
In ~/bin/preview2chrome.scpt,
In ~/Library/Services, a Run Shell Script service named Preview2Chrome.workflow containing:
Option-V assigned as a shortcut key for Preview2Chrome.workflow .
This solution requires manually opening the destination Google Doc and making it the active tab in an active Chrome window with all other Chrome windows minimized. That's not much of a restriction for my purposes, but it would be nice to have an solution that knows how to paste to the destination doc no matter what tabs and windows are active.