1) You can use several
Get Value of Variable actions to build a list to pass to your script or use the
osascript shell script to get variables via AppleScript - for example:
osascript -e 'tell application "Automator" to return value of variable "New Storage" of front workflow'
2) The following
Run AppleScript action will get the Spotlight comments from Finder Items, for example from a
Get Finder Items 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}
(*
get Spotlight comments from Finder items
input: a list of Finder items (aliases)
output: a list of Spotlight comments
*)
set output to {}
repeat with AnItem in the input -- step through each item in the input
tell application "Finder" to set the end of the output to comment of (AnItem as alias)
end repeat
return the output -- pass the result(s) to the next action
end run
</pre>