Hello, Im new to AppleScript programming and having some trouble trying to get the returned result of the clicked button
I have a list of list of items, and two buttons (Show, Hide). I want to do an If then else statement depending on if the button selected was show or Hide... Here is an example of what im trying to do..
Right now, with that list I cant even (Display Dialog) the Button Returned of Result.. i would get this error:
error "Can’t get button returned of {\"User Library\"}." number -1728 from button returned of {"User Library"}
I would select "User Library" from the List
and then Select the Button "Show" Expecting the Display dialog box to show "Button Returned Show"
I'm usually doing Visual Basic or SQL and apple script is new to me, so any help would be wonderful
Thank you.
I have a list of list of items, and two buttons (Show, Hide). I want to do an If then else statement depending on if the button selected was show or Hide... Here is an example of what im trying to do..
Code:
set SelectedItem to (choose from list {"User Library", "Hidden Files", "Something1", "Thinking"} with prompt "Choose" with title "Show/Hide" OK button name "Show" cancel button name "Hide")
if SelectedItem is "User Library" then
[INDENT]IF Button Returned of Result is "SHow" THEN DO SHELL Script "Show example"[/INDENT]
[INDENT]IF BUtton returned of Result is "Hide" THEN DO SHELL SCRIPT "Hide Example"[/INDENT]
IF SelectedItem is "Hidden file" THEN
[INDENT]IF Button Returned of Result is "SHow" THEN DO SHELL SCHRIPT "Show Hidden"
IF BUtton Reutned of Result if "Hide" THEN DO SHELLS CRIPT "Hide Hidden"[/INDENT]
--Continue for Each List Item and Button Option
error "Can’t get button returned of {\"User Library\"}." number -1728 from button returned of {"User Library"}
I would select "User Library" from the List
and then Select the Button "Show" Expecting the Display dialog box to show "Button Returned Show"
I'm usually doing Visual Basic or SQL and apple script is new to me, so any help would be wonderful
Thank you.