Running multiple actions on multiple items selection

Discussion in 'Mac Programming' started by 1theo0, Dec 18, 2012.

  1. macrumors newbie


    Jul 21, 2012
    Hello! Can I make a script say "A" then "B" (ActionA and ActionB) if the user selects both options in the list? I can't install AppleScript Studio right now, and wanted to know if it is possible to do this with AppleScript Editor...
  2. macrumors regular

    Jan 3, 2008
    What you want to do is repeat with each object in the selection list. So your chosen things from the list is something like {"A", "B"}.

    set chosenList to (choose from list Options with prompt "Choose items to be spoken. Hold command (⌘) to select multiple letters" with title "Chocolate" with multiple selections allowed) as text
    -->result is {"A", "B"}

    repeat with anItem in chosenList
    if anitem is "A" then
    end if

    if anItem is "B" then
    end if

    if anItem is "C" then
    end if
    end repeat

Share This Page