How do you get these results in separate automation variables?
I made a small automaton script that runs a bash shell script and gets two exits ... When viewing the results, it looks like this ...
I want them in two automaton variables Suppose I used a script like
echo "200"
echo "19 hours, 4 minutes and 42.765 seconds"
and when viewing the results, it shows this (and I want each one to be an automatic variable called count and duration ). I want it to be sent to a notification with subtitles as " count files processed" and the message passed " duration ". How can I achieve this?
source to share
You can modify Automator variables with applescript. The variables must exist in the workflow , so you first need to add two variables to get something like the following image:
You can set anyting as your initial value ...
After the above, you can use the following applescript right after your shell script
on run {input, parameters}
set value of variable "Count" of front workflow to item 1 of input
set value of variable "Duration" of front workflow to item 2 of input
return input
end run
It's not entirely correct (like not checking the number of arguments in the input), but you get the idea.
So after the following:
Your automator variable Count
will hold 200 and your variable Duration
will hold text.
source to share