Automator, my little robot friend

by Giles Turnbull

Related link: http://www.apple.com/macosx/features/automator/



A week has passed since my upgrade to Tiger, and I think I've found a new friend -- Automator.



Hardly a day goes by without me thinking: "Hang on! Perhaps I could use Automator to whip up a simpler way of doing this!"



I've been really enjoying toying around with workflows, trying to find new ways of doing things. Or in some cases, new things to do. Nothing terribly complex or world-changing; in fact, usually very simple and basic. But useful.



"Examples, give us examples!" you cry. OK, here's some:



Simpler weblogging



I try to post regularly on my weather weblog, Rising Slowly but find the process of grabbing images then resizing them to a specific width tedious and overly time-consuming. (In other words, I know it only takes a few seconds, but every time I have to do it I feel like it's just that little bit like too much hard work. Hurrumph.)



So I created two workflows, one for turning an image dragged out of my browser into a 100x100 thumbnail, and another for resizing images dragged in the same way to 394 pixels wide.



As yet there are no actions for MarsEdit, the editor I use to maintain that particular site; but as soon as any appear, I can see both these workflows being further amended to make life even simpler.



Use Markdown in TextEdit



You may well have heard of Markdown, a chunk of Perl that does an excellent job of converting suitably-marked-up text into valid XHTML. I use it all the time in BBEdit (in fact, I'm writing this very post in this manner).



Using three very simple Actions, you can now make use of Markdown in a TextEdit document too: Get Contents of TextEdit Document -> Run Shell Script (point this to markdown.pl) -> Set Contents of TextEdit Document. Save in your Applescripts folder for easy access, any time.



One thing that has bothered me during all this noodling around in Automator, is that there's no pre-installed Action along the lines of 'Get contents of clipboard'. I keep wanting to use this in many of the workflows I play with, and if it existed then my Markdown example above could be used in all sorts of other text editors and word manglers.



With a bit more time, I might be able to sit down and make such an Action myself, but no doubt someone else has already created it, or will do so much sooner than I can.




What simple little workflows have you been cooking up? Or, what's the craziest, longest, most complex workflow you've created?


8 Comments

mattwebb
2005-05-16 15:11:59
Working with the clipboard
pbcopy and pbpaste are two built-in command-line utilities to use the clipboard. Would Automator be able to use them?
waynesmallman
2005-05-17 00:40:05
Close...
"One thing that has bothered me during all this noodling around in Automator, is that there's no pre-installed Action along the lines of 'Get contents of clipboard'."


Snap!


The first three things that I wanted to do with Automator relied on grabbing something from the clipboard.


Being a designer and a developer, I have a need to pluck things from the clipboard on a regular basis, be it an image or some text.


Since you can't do that, I'm not sure what use Automator is going to be until Apple add that functionality in.


Also, most of the applications that Automator makes use of are simply not part of my workflow. So the vast majority of the processes are just no good to me at all.


I had very high hopes of Automator, but there's just nothing there for me right now. Give it time and I'm sure more will be more added by both Apple and third parties...

otra
2005-05-17 06:36:12
HumaneText
Instead of Automator, you can use HumaneText to convert Markdown to XHTML and back. It's a small program you can access from the Services menu, which is available not just in TextEdit, but in (almost) all programs.


http://gu.st/proj/HumaneText.service/

jimothy
2005-05-17 08:30:32
Markdown and BBEdit
Why not just use Markdown from the BBedit #! menu, as described on the Markdown project page?
mwalker
2005-05-17 08:48:54
Working with the clipboard
While I'm not expert on the commands, pbcopy and pbpaste seem to be text only (including rtf output). Automator has a Run Shell Script action that will work for them, though.


Make a sample workflow:
(1) Run Shell Script -- pbpaste
(2) View Results


Seems to work with text in the pasteboard (or things that convert to text), if text is what you need.

has01
2005-05-18 04:12:09
Working with the clipboard
A more type-savvy option would be to write a simple AppleScript-based Action using the the clipboard command from the Standard Additions.


HTH

viae
2005-05-18 04:13:06
Working with the clipboard
Why not use an applescript...?
guet2
2005-07-28 16:07:32
Working with the clipboard
Just in case anyone else is searching for this - to get the contents of the clipboard add an applescript action with the following 1 line of content - this will pass on the clipboard to the next action


return the clipboard


How Apple managed to neglect this is beyond me.