ayuda de AppleScript

1

Estoy intentando crear una aplicación que abra aplicaciones diferentes y te proporcione una lista, pero sigo recibiendo mensajes de error. ¿Es posible hacer esto?

display dialog "Hello and welcome to my app!" buttons {"Login", "Quit"} default button 1

if the button returned of the result is "Login" then
    display dialog "Username:" buttons {"Admin", "Guest"} default button 1 with title "Choose user"
else
    return
end if

if the button returned of the result is "Admin" then
    display dialog "Enter Pasword" default answer "" buttons {"Submit"} with title "Enter  password" with hidden answer
else
    display dialog "You have selected guest! Guest is not currenty enabled, since this build is in beta. Thank you!" buttons {"OK"}
    return
end if

if the text returned of the result is "Cameron67" then
    display dialog "Welcome! What would you like to do?" buttons {"Chrome", "Messages", "More"}
    if the button returned of the result is "Chrome" then tell application "Google Chrome"
        activate
    end tell
    if the button returned is "Messages" then tell application "Messages"
        activate
    end tell
else
    display dialog "Incorrect password" buttons {"OK"} default button 1 with icon stop
end if
    
pregunta PLASMAGHOST 06.02.2016 - 16:28

1 respuesta

2

Use esto en su lugar ( fuente y explicación breve ):

if the text returned of the result is "Cameron67" then
    set the_results to (display dialog "Welcome! What would you like to do?" buttons {"Chrome", "Messages", "More"})
    set button_returned to button returned of the_results
    if button_returned is "Chrome" then tell application "Google Chrome"
        activate
    end tell
    if button_returned is "Messages" then tell application "Messages"
        activate
    end tell
    if button_returned is "More" then ...
    
respondido por el klanomath 06.02.2016 - 17:17

Lea otras preguntas en las etiquetas