In a Service, how to get a URL from rich text? I'm interested in making a Service (using Automator if possible) that allows me to perform an action on a URL.

If the URL exists as plain text, this works just fine.

However, if the URL is a link in rich text, then my service gets the link's title, rather than it's URL.

How can I obtain the URL when activating a Service on a rich text link?
You can do it using the app TextSoap. The cleaners "Extract URLs by Replacing" and "Extract URLs by Appending" work with rich text format.

You can also use the following AppleScript:

tell application "textsoap7"
    cleanClipboard with "Extract URLs by Replacing"
end tell