Using Clipboard in Omni Automation


#1

I want to get and set the contents of system clipboard in an OmniOutliner Automation JavaScript. I am aware of the Pasteboard page at omni-automation.com; however, it only shows how to use Editor.copyNodes to copy the currently selected nodes to the system clipboard.

I would like to know how to perform basic operations in JavaScript in an Omni Automation script (for Omni Outliner):

  1. Given str, a String, put str on the system clipboard.
  2. Set str to the contents of the clipboard, which contains a single unformatted text item.

An example of (1) why I want (1) is as part of a Keyboard Maestro macro put the topic of the current item of an outline on the system clipboard, switch to another application, and paste. Similarly, an example of using (2) would be a Keyboard Maestro macro that executed some steps that include copying a selection from another application, switching to Omni Outliner, and using the contents of the system clipboard to construct some text that will go in an outline item.


#2

I’m keen to do something similar to this. I have a slightly strange document format and once I have the outlines finished I’m keen to get it into my editor (or a series of web forms). While I could try to find a series of integration points for these apps and corporate tools, it’s pretty hard.

The simpler solution for me is to generate markdown and put it straight into the pasteboard. Which I can then drop into the array of tools I need to work with.