OS X utility for wrapping text in HTML?
April 10, 2009 2:34 PM   Subscribe

Is there an OS X key command utility or service that will let me wrap selected text in clipboard text and predefined strings (such as HTML)?

The blogging client Ecto has a nifty feature that will wrap selected text with whatever is on your clipboard plus predefined strings such as "a href" tags for quickly adding html links. Thus, linking some text is easy:

1. copy a URL
2. select the desired anchor text
3. hit key command and text is wrapped in a "a href" tag using your copied URL.

Is there an OS X utility that will allow me to do this in any app? This would be especially useful in a web browser where I am constantly linking text in forums and other input fields.

I've got Butler which can paste stored text, but it doesn't do the wrapping.
posted by Typographica to Computers & Internet (5 answers total)
 
Best answer: if you use Firefox, Make Link (by mefi's own roryparle) will wrap the link for you in several markup formats.
posted by scruss at 4:05 PM on April 10, 2009


I don't know of any specific utility to do this, but it seems to me like a relatively simple job for Applescript. Unfortunately, I don't know the first thing about how to write Applescripts, I only use them.

TextSoap was the first scriptable text-manipulation app that came to my mind.
posted by bengarland at 4:11 PM on April 10, 2009


You might be able to get textexpander to do this, but I have never used the app myself.
posted by OwlBoy at 6:20 PM on April 10, 2009


Best answer: Sounds like ThisService could do what you want, and more.

Not sure how handy you are with scripty things, but here's enough to do what you described above. Paste this into a new document in the Script Editor application:

on process(input)
    return "<a href=\"" & (the clipboard as Unicode text) & "\">" & input & "</a>"
end process


Save it somewhere, then open ThisService. Give it a name, select the script you saved, and select "Filter (both)." Select a shortcut if you'd like and you're good to go.
posted by Garak at 9:29 PM on April 10, 2009


Response by poster: Thank you all for your replies. Garak: yours is exactly what I need. Unfortunately it doesn't seem to work in Firefox (the app where I need it most). Is this because Firefox isn't Applescript aware?
posted by Typographica at 9:37 PM on April 12, 2009


« Older China is really big! Where do I go?   |   iCal for windows? Newer »
This thread is closed to new comments.