Applescript per creare un messaggio in uscita in Mail.app con il mittente specificato

1

Ho molti account in Mail. Uso KeyboardMaestro per automatizzare gran parte di ciò che faccio, ma non ho trovato il modo di farlo in modo affidabile per scegliere un determinato account in una nuova finestra di messaggio. Mi chiedo se riesco a far scrivere a applecript per me.

Ho il seguente:

tell application "Mail" to make new outgoing message with properties {sender:"[email protected]"}

e Mail aprono obbedientemente una nuova finestra di messaggio ... ma non si preoccupa di impostare correttamente il mittente: - (

Ho anche provato a usare l'intera stringa che appare nel menu a comparsa Sender nella finestra (che sembra essere l'Alias, nel pannello Account della finestra delle preferenze di Mail), oltre alla sottostringa prima del trattino (che sembra essere il nome completo nelle preferenze di Mail). Niente funziona.

Qualcuno è riuscito a farlo funzionare?

    
posta skiaddict1 30.05.2018 - 00:04
fonte

1 risposta

0

Da qui

Formato leggermente diverso per la proprietà sender .

tell application "Mail"
  set theOutMessage to make new outgoing message with properties {visible:true}
  tell theOutMessage
      make new to recipient at end of to recipients with properties {address:"[email protected]"}
      set sender to "FirstN LastN <[email protected]>"
      set subject to "Message Subject"
      set content to "Message Text"
  end tell
end tell

Quindi il tuo sarebbe ...

tell application "Mail" to make new outgoing message with properties {sender:"FirstN LastN <[email protected]>"}

Puoi trovare e modificare FirstN e LastN in Preferenze di Sistema > Account Internet > [Nome email] > Dettagli > Nome

    
risposta data 30.05.2018 - 00:46
fonte

Leggi altre domande sui tag