1 votos

Ayuda AppleScript

Estoy tratando de hacer una app que le abrir diferentes aplicaciones y le dará 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

1voto

klanomath Puntos 19587

Utilizar este (origen y breve explicación):

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 ...

AppleAyuda.com

AppleAyuda es una comunidad de usuarios de los productos de Apple en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros usuarios, hacer tus propias preguntas o resolver las de los demás.

Powered by:

X