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!
When you create the Automator workflow, choose "Application" instead of "Workflow." This creates a stand-alone app that will run with the double-click instead of opening Automator. Since you already have the Workflow, you can open it and then choose File, Convert To... Then choose Application.
The other suggested answers work, but the simplest and most straightforward way is to use an AppleScript variable to define the list choices.
A text variable can store only one item of plain text, but an AppleScript variable can be structured as an array, which is exactly what you need to define a list.
In the Variables Library, under Utilities, drag an AppleScript variable into the Workflow above the Choose from List action.
Edit the Variable Options and define its Script as an array of text strings, containing your desired list of choices.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With