Choose From LIst Feature

I am having problems using the Choose From List in Automator. Can someone walk me through how to use this? I am trying to have certain workflows listed in the list that a user can choose to run the workflows. Any help would be greatly appreciated.

Thanks,

15" Macbook Pro 2.4 Ghz, Mac OS X (10.4.10)

Posted on Apr 10, 2008 9:02 PM

Reply
4 replies

Jun 3, 2008 10:47 AM in response to brademcee

I'm having the same issue. I just want to make a list of 8 items to choose from, but there is approximately zero documentation on how to do this in Automator help. Here is my desired flow...

1. Get specified text (SHOULD be able to enter comma separated values such as "1. First option, 2. Second, etc")

2. Choose from list (which requires text passed form previous action)

3. Set variable of chosen option

4. Rename files based on text from variable ( "SELECTEDOPTION 6-3-08JSYWN.mov")

Any ideas?

Jun 3, 2008 4:35 PM in response to brademcee

brademcee wrote:
I am having problems using the Choose From List in Automator. Can someone walk me through how to use this? I am trying to have certain workflows listed in the list that a user can choose to run the workflows. Any help would be greatly appreciated.

Thanks,



So the first action in your workflow has to be "Get Specified Finder Items", where you have to add the "certain" workflows. Or you add the folder, where they are stored and add another action to the workflow "Get Folder Contents"

Next action "Choose from List"
followed by "Open Finder Items"

Are this Workflows saved as .workflow or as .app ?
If they are saved as .workflow you have to open them with
1) Automator Launcher.app (If you are really still on 10.4.10)
or
2) Automator Runner.app (If you already running Leopard)

If they are saved as .app use "default Application" to open them

@tiredofblackshirts:
I don´t know, how to realize this with Automator. I think you have to use Applescript for this.

Spażek

Jun 4, 2008 9:34 PM in response to brademcee

The "Choose from List" action takes as it's input a list of text items that have been output from a previous action, such as getting Finder items or paragraphs of a text file. Unfortunately, the action doesn't seem to be general-purpose enough to do what you want, but it is easy to do from an AppleScript action:

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #FFDDFF;
overflow: auto;"
title="this text can be pasted into an Automator 'Run AppleScript' action">
on run {input, parameters}
(*
choose item(s) from a list of Finder items
input: a list of Finder items (aliases)
output: a list of Finder items (aliases) selected
*)

set output to {}
set NameList to {}

tell application "Finder"
repeat with AnItem in the input
set the end of NameList to (name of AnItem) -- just the names
-- set the end of NameList to (AnItem as text) -- the full paths
end repeat

activate me
set TheChoice to (choose from list NameList with title "Choose from List" with empty selection allowed) -- and multiple selections allowed)

if TheChoice is false then
error number -128 -- cancel
else
repeat with AnItem in the input -- find a match
if (name of AnItem) is in TheChoice then set the end of output to (contents of AnItem)
end repeat
end if
end tell

return the output -- pass the result to the next action
end run
</pre>

The above action can be used in a workflow such as:

1) Get Specified Finder Items (add workflows as desired)
2) Run AppleScript (the above script)
3) Open Finder Items

The last action seems to be the way to go, since the "Launch Application" and "Run Workflow" don't appear to be able to take an input from a previous action.

HTH

Jun 4, 2008 9:47 PM in response to tiredofblackshirts

You should really start a new topic with your question rather than hijacking someone else's, since your problem is different than the OP. The solution is similar, but different enough to be confusing when trying to follow the thread. With that said...

The following AppleScript action will return the text item(s) chosen from a list that is generated by getting the paragraphs of the input text (for example, from the "Get Specified Text" action):

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #FFDDFF;
overflow: auto;"
title="this text can be pasted into an Automator 'Run AppleScript' action">
on run {input, parameters}
(*
choose item(s) from text
input: text - items are delimited by paragraphs (returns/newlines)
output: a list of paragraphs selected
*)

set output to {}
set NameList to {}

set NameList to paragraphs of (input as text)

activate me
set TheChoice to (choose from list NameList with title "Choose from List" with empty selection allowed) -- and multiple selections allowed)

if TheChoice is false then
error number -128 -- cancel
else
set output to TheChoice
end if

return the output -- pass the result to the next action
end run
</pre>

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Choose From LIst Feature

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.