Question

enter image description here

1 . Opens up dialogue box

2 . Asks for text

3 . Says input text from 2

4 . * Loop to step 2? *

5 . Ask for finder item

I'm trying to find a way to use AppleScript in order to loop to a certain point in Automator . Unfortunately, the Loop utility in Automator automatically loops the workflow all the way to beginning and there is no option to change the parameters .

Does anybody know any AppleScript code that can specify where the loop starts and ends in Automator ?

Was it helpful?

Solution

ok so here is what you do

  1. create a work flow of the loop and save it

enter image description here

2 then in your main workflow call your loop workflow

enter image description here

3 run main workflow (bob's your uncle)

OTHER TIPS

Can't you just use AppleScript for steps 2 and 3?

repeat
    display dialog "" default answer ""
    say text returned of result
end repeat

The script exits when you press the cancel button in the dialog. To prevent it, put the repeat loop in a try block.

It is worth noting that Apple has provided a folder for called workflows. Place called workflows in this folder "Mac HD:Library:Application Support:Apple:Automator:Workflows:" (or create it in your user lib folder) and your workflow will appear in the Workflow pop up of the Run Workflow action. No navigation needed, and your called workflows are all in the same place. It's also worth mentioning that "Run Workflow" is the only way I've found to have Automator take a folder full of subfolders and process the subfolders individually (loop won't do it, because the first steps can't be repeated).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top