kerrydawson Posted September 23, 2013 Share Posted September 23, 2013 I'm trying to create a new message in Alfred using Outlook to be generated from a specific account and I can't figure this one out. I have the following working in Mail. Does anyone have any idea what I would write to get this to work in Outlook. As an example: Outlook - new mail message - from account ..... This is how I wrote it in AppleScript for Mail. Thanks tell application "Mail" activate set theMsg to make new outgoing message with properties {sender:"<ksdawson@icloud.com>", visible:true} set message signature of theMsg to signature "Kerry Dawson" end tell Link to comment
jdfwarrior Posted September 23, 2013 Share Posted September 23, 2013 I'm trying to create a new message in Alfred using Outlook to be generated from a specific account and I can't figure this one out. I have the following working in Mail. Does anyone have any idea what I would write to get this to work in Outlook. As an example: Outlook - new mail message - from account ..... This is how I wrote it in AppleScript for Mail. Thanks tell application "Mail" activate set theMsg to make new outgoing message with properties {sender:"<ksdawson@icloud.com>", visible:true} set message signature of theMsg to signature "Kerry Dawson" end tell Looks like you have to use AppleScript to grab the account you want and set it that way. For instance, I made two accounts, both Gmail based, and named one 'jdfwarrior' and the other 'jdavidferg'. AppleScript to send from a specific account looks like this.. tell application "Microsoft Outlook" set theAccount to the first imap account whose name is "JDavidFerg" set theMessage to make new outgoing message with properties {account:theAccount} open theMessage end tell Obviously, the 2nd line specifies the account. There are multiple account types to chose from in Outlook though. It contains 'exchange account', 'pop account', 'imap account', and 'ldap account' Link to comment
kerrydawson Posted September 23, 2013 Author Share Posted September 23, 2013 Looks like you have to use AppleScript to grab the account you want and set it that way. For instance, I made two accounts, both Gmail based, and named one 'jdfwarrior' and the other 'jdavidferg'. AppleScript to send from a specific account looks like this.. tell application "Microsoft Outlook" set theAccount to the first imap account whose name is "JDavidFerg" set theMessage to make new outgoing message with properties {account:theAccount} open theMessage end tell Obviously, the 2nd line specifies the account. There are multiple account types to chose from in Outlook though. It contains 'exchange account', 'pop account', 'imap account', and 'ldap account' Hi David, Thanks. This worked perfectly. I never would have gotten this. I have an icloud, gmail and outlook.com account I generate email from in Outlook. As an example, I wrote one like this: Link to comment
kerrydawson Posted September 23, 2013 Author Share Posted September 23, 2013 Hi David, Thanks. This worked perfectly. I never would have gotten this. I have an icloud, gmail and outlook.com account I generate email from in Outlook. As an example, I wrote one like this: I now have the three accounts in Alfred as follows.: I think I should spend some more time over here. I might get onto scripting. I actually can't find a good method of learning AppleScript. it's better to try to put it together this way and then you get it. Thanks again for your help. Much appreciated. This will save a lot of time. Kerry Link to comment
jdfwarrior Posted September 23, 2013 Share Posted September 23, 2013 I now have the three accounts in Alfred as follows.: I think I should spend some more time over here. I might get onto scripting. I actually can't find a good method of learning AppleScript. it's better to try to put it together this way and then you get it. Thanks again for your help. Much appreciated. This will save a lot of time. Kerry Honestly, I've never really seen a good single resource for learning AppleScript either. I started getting a little more familiar with it when I started my role with Alfred. I'm sure there's still a lot I don't know but, Google is your friend. Most of the time (so far), anything I've needed to accomplish with AppleScript, someone else has already done it, or has done something similar that I can use to get started. Glad you got things working. Link to comment
kerrydawson Posted September 23, 2013 Author Share Posted September 23, 2013 Hey David, Thanks again. It's interesting you say that about Google as I use that all the time when I'm working on Applescripts. You’re right. You can find a lot. For some reason I couldn’t find this. I think it should be almost available somewhere as I looked high and low. I’m glad I’m not the only one that hasn’t found anything great to learn to AppleScript by. I think I have three books bought over time on the subject and I get to about page 100 and then I get lost. I can’t remember this from that. Even when you write an AppleScript I find for as English like as it’s supposed to be it’s not as logical as I’d think it should be. I’ve heard though seasoned developers have a terrible time with AppleScript and actually don’t like it due to it’s syntaxing. However, it’s super handy with Alfred and if I don’t have workflows from the shared library the one’s I’ve done are all done in AppleScript so it does get the job done for me. Alfred is just a nice way to invoke those scripts and extend the power of Alfred out. Anyway, time to hang out around here more as this is the way to learn this stuff I think. Kerry Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now