Automator: How do I use the Choose from List action?

bmauter picture bmauter · Jul 11, 2012 · Viewed 14.6k times · Source

I'm trying to create a Service using Automator that simply calls textutil convert. Eventually, I want to be able to right-click a docx file and convert to text, rtf, html, etc. After I right-click I want a very simple popup asking for the desired format.

I see the Choose from List action. It has no options. Somewhere I got the idea to make the input of Choose from List be Get Specified Text. I then tried putting my list of values in Get Specified Text. However, when I run it, I only get one line. I've tried one item per line, comma-delimited, space-delimited and even surrounding with curly braces, delimited with commas. Nothing works.

How do I get that chooser dialog to show all my options? Also, is there a way to restrict the selection to one item?

Thanks!

automator screenshot result

Answer

jackjr300 picture jackjr300 · Jul 12, 2012

Here is the solution to select only one line in a list.

Remove ("Get Specified Text" and "Choose from List") actions.

Add the "Run AppleScript script" action. 1- Cut the text in the action. 2- Copy/paste this text in the action.

on run
    choose from list {"TXT", "RTF", "RTFD", "HTML"} with prompt "Please make your selection" without multiple selections allowed and empty selection allowed
    return the result as string
end run