Created
April 27, 2020 23:29
-
-
Save hissain/421290e093c2c228918fb52643386219 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set listWithLinks to {"google.com", "bing.com", "yahoo.com"} | |
set listWithLabels to {"Google", "Bing", "Yahoo"} | |
set dialogTitle to "Select & Go to open link" | |
set buttonOK to "Go" | |
set buttonCancel to "Cancel" | |
set choosedLabels to choose from list (listWithLabels as list) with title dialogTitle OK button name buttonOK cancel button name buttonCancel with multiple selections allowed | |
if false is choosedLabels then return | |
repeat with i from 1 to number of items in choosedLabels | |
set choosedLabel to item i of choosedLabels | |
repeat with i from 1 to number of items in listWithLabels | |
set lookupLabel to item i of listWithLabels | |
if choosedLabel is lookupLabel then | |
set link to item i of listWithLinks | |
open location "http://www." & link | |
end if | |
end repeat | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment