Link Search Menu Expand Document

Dialogs Allowing Multiple Selections

Bunch offers several methods for creating interactive Bunches, but you can also use a little scripting if you need more flexibility. In this case, we’ll add a dialog that allows the user to select multiple options and then act on them.

Since writing this howto, multi-select dialogs have been added to Bunch. That said, this is still a good example of scripting within a Bunch.

You can use AppleScript to display a multiple choice dialog allowing multiple selections. This can be used to launch multiple bunches with user interaction.

set _res to choose from list {"Comms", "Podcast Record", "Podcast Edit", "Music"} with prompt "What next?" OK button name "Launch" with multiple selections allowed and empty selection allowed

repeat with _bunch in _res
    do shell script "open 'x-bunch://open/" & _bunch & "'"
end repeat

Call a script like that within one Bunch, and it can lead to launching other Bunches based on user response.

This strategy can be used with simple yes/no dialogs as well, taking alternate paths based on the response. Any script that can accept user responses via a GUI can use the Bunch URL handler to continue processing Bunches.


Backtrack