I'm trying to create an Automator Service that will act on selected text, converting dashes to spaces, and also making word caps for all the text.
A friend gave me this python script (I know nothing about python or shell scripting):
#! /usr/bin/python cliptext = "%clipboard" print cliptext.replace('-', ' ').replace('%', ' ').replace('&', ' and ').replace('#', ' ').title()
It works great as a TextExpander snippet, but I'd like to have it available in the Services menu as well. I don't need it to use any specific scripting language, it just needs to run within Automator. My coding buddy had no experience with Automator so he couldn't help out. His script requires copying the text to the clipboard, and then runs the formatting and pastes the result. I'd like to be able to just run this on the selected text and not have to deal with the Clipboard (at least manually).
The particular use for this is to rename photo uploads on Flickr, since Flickr uses the filename to generate the photo name. When exporting artwork via Photoshop or Illustrator using Save For Web, the lowercase and dashes are my default settings. I want to be able to highlight the Flickr title, and then run the Service to reformat the file name to a properly formatted title.