Im new to creating scripts for Apple (MacOsx Ventura)… I would like to create an AppleScript with serveral buttons 3 to 9 depending on what Shell script I want to create… What I have now works in Mac terminal with selecting by pressing 1, 2, 3, etc… I like the look of Buttons… this method looks good so… but how to select the option and running a shell script or applescript after clicking ok
set optionList to {“Shell Script-1”, " Shell Script-2", " Applescript-1", " Applescript-2"}
set chosenScript to choose from list optionList with prompt “Choose a Script to run:”
if chosenScript is false then
error number -128 (* User cancelled *)
else
set chosenScript to chosenScript’s item 1 (* extract choice from list *)
end if
display dialog "You chose a " & chosenScript & “!”