Dave Girard's 101 Autodesk® Maya® Tips is now available in Kindle, interactive iPad edition and DRM-free EPUB/PDF editions. Work faster, cry less. Read more about the ebook.




Follow cgbeige on Twitter

Topics by tag:



Recently published articles by Dave G:



Free downloads by Dave G:



Mac OS X-only downloads:

Using the Clipboard as a Working Buffer: Automator for Apps that Don’t Support Automator

If you use a text editor like TextMate, BBEdit or even Chrome in OS X, you get full support for Automator’s text replacement features but some applications don’t use the Cocoa classes for their text boxes so they don’t get access to these. Nevertheless, there is a good workaround for these cases when you want to filter text in one of these Automator-unaware applications: send the clipboard to your Automator script and send the output back to the clipboard. As I mentioned in my recent Ars Technica article, OS X has a ton of command line applications to bridge the GUI and cl (open, say, etc) and they have two built-ins for clipboard manipulation – “pbcopy” and “pbpaste” – which can be used to send text to the clipboard (pbcopy) or echo the clipboard into stdout (pbpaste). So, if I want to take some attribute text from the Maya Script Editor and turn it into a variable, it’s easily done by using this clipboard buffer setup in an Automator service:

See it in action:

That service can be bound to a hotkey in the Keyboard panel of the System Preferences for extra speediness.

1 note | Permalink

  1. polygonspixelsandpaint posted this