mail errorhandler di Applescript

0

Ho uno script per inviare un messaggio di posta elettronica, ma vorrei rilevare se nessun account di posta elettronica è configurato e fare qualcos'altro.

C'è un modo per rilevare o intrappolare questa condizione? Grazie.

tell application "Mail"
    set new_message to make new outgoing message with properties {visible:false, subject:"AppleScript-2014", content:("Success " & linefeed & "user: " & userName & linefeed & "OS: " & (system version of (get system info)) as rich text) & linefeed & "IP: " & IPv4 address of (get system info)}

    tell new_message
        make new to recipient with properties {name:"Len", address:"[email protected]"}
    end tell
    delay 7
    send new_message
end tell
    
posta Len 16.06.2014 - 21:36
fonte

1 risposta

0

Questo dovrebbe farlo ...

tell application "Mail"
    set nAccounts to every account
    log "Number of accounts: " & (get count of nAccounts)
end tell
    
risposta data 17.06.2014 - 16:40
fonte

Leggi altre domande sui tag