[GastForen Programmierung/Entwicklung AppleScript Wie legt man den Absender in einem Outlook-Pop-Konto mit Applescript fest

  • Suche
  • Hilfe
  • Lesezeichen
  • Benutzerliste
Themen
Beiträge
Moderatoren
Letzter Beitrag

Wie legt man den Absender in einem Outlook-Pop-Konto mit Applescript fest

ChangeAgent
Beiträge gesamt: 5

3. Dez 2021, 09:52
Beitrag # 1 von 8
Bewertung:
(6475 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Bitte entschuldigen Sie meine nicht perfektes Deutsch, ich bin besser in Englisch.

Code
   tell application "Microsoft Outlook" 
set theContent to "Mail Content etc."
set theMessage to make new outgoing message with properties {subject:(("Month ") & (do shell script "date '+%m'")), content:theContent}
make new recipient with properties {email address:{address:"to@mail.com"}} at end of to recipients of theMessage
make new recipient with properties {email address:{address:"to@mail.com"}} at end of cc recipients of theMessage
open theMessage
end tell



Dieses Skript funktioniert einwandfrei. Ich wurde gerne eine Zeile hinzu fugen, die eines von mehreren Pop-Konten auswählt, die ich habe, damit es von diesem POP-Konto gesendet wird.

Idealerweise wird dieses Konto ausgewählt und die resultierende E-Mail enthält auch die Signatur, die ich unter dieser Adresse gespeichert habe. Derzeit wird immer mein Hauptkonto und die dazugehörige Signatur ausgewählt, aber das ist nicht das Konto, von dem ich es gerne schicken will.

Ich stecke hier fest und weiß nicht, wie ich das losen soll. Ich freue mich über Ihre Vorschläge.
X

Wie legt man den Absender in einem Outlook-Pop-Konto mit Applescript fest

Hans Haesler
  
Beiträge gesamt: 5826

3. Dez 2021, 10:55
Beitrag # 2 von 8
Beitrag ID: #581886
Bewertung:
(6450 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hi ChangeAgent,

a big “welcome” at the forum AppleScript at HDS! :-)

I’ll be back at my computer tomorrow evening. If all goes well ...

In the meantime, hopefully, another member will jump in and help you to solve your problem.

BTW: Your German is quite good. :-)

Best regards,
Hans


als Antwort auf: [#581885]

Wie legt man den Absender in einem Outlook-Pop-Konto mit Applescript fest

ChangeAgent
Beiträge gesamt: 5

3. Dez 2021, 12:04
Beitrag # 3 von 8
Beitrag ID: #581889
Bewertung:
(6422 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hi Hans, thank you for the compliment. I believe that when one lives in a country one should learn the language.

Hopefully an other member knows the answer or maybe you do. As the German speaking people say: I push my thumbs.

PS Liebe Leute ihr könnt auch gern in Deutsch antworten, es sei dann Ihr wollt Englisch üben.


als Antwort auf: [#581886]
(Dieser Beitrag wurde von ChangeAgent am 3. Dez 2021, 12:05 geändert)

Wie legt man den Absender in einem Outlook-Pop-Konto mit Applescript fest

Hans Haesler
  
Beiträge gesamt: 5826

3. Dez 2021, 12:59
Beitrag # 4 von 8
Beitrag ID: #581890
Bewertung:
(6405 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hi ChangeAgent,

yes, I have some knowledge of scripting “Outlook”. But I do hate the bugger ...

However, without sitting at my Mac, I’m not able to write useable code right now. So this must wait until tomorrow evening.

Since there are some good lads around here who know things better than me, chances are good that one of them will get in touch. ;-)

*****
So you’re calling from Switzerland. Just out of curiosity: Where are you from?

Best regards,
Hans


als Antwort auf: [#581889]

Wie legt man den Absender in einem Outlook-Pop-Konto mit Applescript fest

ChangeAgent
Beiträge gesamt: 5

3. Dez 2021, 13:04
Beitrag # 5 von 8
Beitrag ID: #581891
Bewertung:
(6400 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Thanks. As I said hoping to there is somebody who knows how to fix it. And yes i am not a fan of MS Outlook either, but there you go.

Scotland.


als Antwort auf: [#581890]

Wie legt man den Absender in einem Outlook-Pop-Konto mit Applescript fest

Hans Haesler
  
Beiträge gesamt: 5826

5. Dez 2021, 22:02
Beitrag # 6 von 8
Beitrag ID: #581903
Bewertung:
(6275 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hi ChangeAgent,

you're welcome. Finally, I could take care of your request this evening, only.

The ideas is to set the variable theAccount to the name of the account to use.
And insert account:theAccount, at the beginning of the properties.

Please give this a try:

Code
tell application "Microsoft Outlook" 
set theAccount to the first exchange account whose name is "The-name-of-the-account-you-want-to-use"
set theContent to "Mail Content etc."
set theMessage to make new outgoing message with properties {account:theAccount, subject:"Test", content:theContent}
make new recipient with properties {email address:{address:"to@mail.com"}} at end of to recipients of theMessage
make new recipient with properties {email address:{address:"to@mail.com"}} at end of cc recipients of theMessage
open theMessage
end tell

I took the line from a working Outlook script which I wrote for a client in the USA, but did not launch the above expanded code.

Best regards,
Hans


als Antwort auf: [#581891]

Wie legt man den Absender in einem Outlook-Pop-Konto mit Applescript fest

ChangeAgent
Beiträge gesamt: 5

6. Dez 2021, 17:01
Beitrag # 7 von 8
Beitrag ID: #581906
Bewertung:
(6175 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Greetings Hans,

It looks good! And it works! Thanks a million! I am fine-tuning it to ad a bit more, but what you send works.


als Antwort auf: [#581903]

Wie legt man den Absender in einem Outlook-Pop-Konto mit Applescript fest

Hans Haesler
  
Beiträge gesamt: 5826

6. Dez 2021, 17:41
Beitrag # 8 von 8
Beitrag ID: #581907
Bewertung:
(6157 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hi ChangeAgent,

you're welcome. Thank you for the feedback. It's great to hear that it works as expected.

Best regards,
Hans


als Antwort auf: [#581906]
X