D.J. Posted March 17, 2013 Share Posted March 17, 2013 Hi All, I receive a lot of email notifications in different mailboxes and it's getting annoying to click every mailbox and read-all. So I want to create Alfred workflow which would do this with one action. I've found this applescript: tell application "Mail" set read status of every message of inbox to trueend tell So this is how my setup looks: I think I covered everything but it's not working. It finds the action but when confirming it, nothing happens (emails stay unread). Help will be appreciated. Thanks Amoftcoorb 1 Link to comment
jdfwarrior Posted March 18, 2013 Share Posted March 18, 2013 Bump, anyone? I was testing out the code that you provided and it didn't work, as you said, but... I tweaked it a little to do.. tell application "Mail" to set the read status of every message in every mailbox of every account to true It appeared to be working but I quit it before it finished because it was taking forever. Give me a little more time to tinker with it and see if I can't speed it up a bit. I'm going to see if I can't just grab a list of all unread messages and set just those to read. Maybe that will be slightly faster. Link to comment
Carlos-Sz Posted March 18, 2013 Share Posted March 18, 2013 FYI: Pedro Lobo’s Mail Actions workflow has something like this ready written in AppleScript. Link to comment
barrettj Posted March 18, 2013 Share Posted March 18, 2013 You have the language set to /bin/bash when it should be /usr/bin/oascript Link to comment
D.J. Posted March 19, 2013 Author Share Posted March 19, 2013 @David: thanks, that would be great. @barrettj: fixed, thanks, and will keep that in mind. Link to comment
jdfwarrior Posted March 20, 2013 Share Posted March 20, 2013 @David: thanks, that would be great. @barrettj: fixed, thanks, and will keep that in mind. Just curious if you tried Pedro's script and it worked for what you were looking for? If it works, it may be easier to use his than trying to reinvent the wheel with a new script. Just keep me in the loop with what you find and need and I'll try to help out. Thanks Link to comment
D.J. Posted March 20, 2013 Author Share Posted March 20, 2013 I've searched but can't find the mentioned "Mail Actions workflow". Is there a link anywhere? Link to comment
jdfwarrior Posted March 21, 2013 Share Posted March 21, 2013 I've searched but can't find the mentioned "Mail Actions workflow". Is there a link anywhere? http://www.alfredforum.com/topic/379-mail-actions-workflow-updated-v061 Here ya go Link to comment
D.J. Posted March 21, 2013 Author Share Posted March 21, 2013 (edited) Thanks (I was searching Google not the forum ). Downloaded it but I'm not that knowledgeable to be able to decode it and reuse it for my own use. What I've found useful is this command: osascript getUnread.scpt {query} Which "gets" unread mailboxes but I don't have an idea on how to just get messages inside and mark them as read. Help is appreciated. Edited March 21, 2013 by D.J. Link to comment
jdfwarrior Posted March 22, 2013 Share Posted March 22, 2013 Thanks (I was searching Google not the forum ). Downloaded it but I'm not that knowledgeable to be able to decode it and reuse it for my own use. What I've found useful is this command: osascript getUnread.scpt {query} Which "gets" unread mailboxes but I don't have an idea on how to just get messages inside and mark them as read. Help is appreciated. If I give you some AppleScript to get you going would that suffice or are you unfamiliar with AppleScript all together? Link to comment
jdfwarrior Posted March 22, 2013 Share Posted March 22, 2013 Thanks (I was searching Google not the forum ). Downloaded it but I'm not that knowledgeable to be able to decode it and reuse it for my own use. What I've found useful is this command: osascript getUnread.scpt {query} Which "gets" unread mailboxes but I don't have an idea on how to just get messages inside and mark them as read. Help is appreciated. Nevermind, I decided to just go ahead and bang it out. This is still kinda slow because its having to mark that read status of each message on the server, but it does work. It grabs a list of all accounts, then a list of all mailboxes that have an unread count higher than 0, then sets all the messages that are unread in those areas to read. tell application "Mail" set allAccounts to the name of every account repeat with currAccount in allAccounts set unreadMboxes to (every mailbox in account currAccount whose unread count is not 0) repeat with currMbox in unreadMboxes set (the read status of every message in currMbox whose read status is false) to true end repeat end repeat end tell Enjoy. Link to comment
D.J. Posted March 22, 2013 Author Share Posted March 22, 2013 No, not familiar with AppleScript, was doing more or less just copy/pasting from what I could find. The above script works great. Thanks a lot! Link to comment
jdfwarrior Posted March 22, 2013 Share Posted March 22, 2013 No, not familiar with AppleScript, was doing more or less just copy/pasting from what I could find. The above script works great. Thanks a lot! Awesome, glad it works 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