O.rka
O.rka

Reputation: 30677

AppleScript to loop workflow in automator

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 ?

Upvotes: 3

Views: 11283

Answers (3)

Plutonite
Plutonite

Reputation: 1

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).

Upvotes: 0

mcgrailm
mcgrailm

Reputation: 17640

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)

Upvotes: 3

Lri
Lri

Reputation: 27613

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.

Upvotes: 0

Related Questions