RickRussell.org

Church Media Technology, Macs, Faith, and Me

  • Home
  • About
  • MacHash

14

Oct

Update to the Move Mail Applescript

Posted by Rick  Published in Apple, Things, scripts

Today I made an update to my move script that allows you to select more than one message and move them all to the “All Mail” folder. You can refer to my Things Mail Script post if you would like to setup a hot key for the script. Here is the code:


tell application "Mail"
set theSelectedMessages to selection
repeat with selected_message in theSelectedMessages
set currentMailbox to the mailbox of the selected_message
set currentAccount to the account of the currentMailbox
set filedMailbox to "All Mail"
move selected_message to mailbox filedMailbox of currentAccount
end repeat
end tell

no comment

14

Sep

Error in Things Todo Script

Posted by Rick  Published in Things, scripts

In my previous post I had in small error in the script that created the todos in Things from a mail message. Here is the updated script:


tell application "Mail"
set cr to ASCII character 13 -->You can probably use the Unicode Equivalent but I didn't know it and this worked right away.
set LF to ASCII character 10 --> Same as here
set carriage_return to (cr & LF as Unicode text)
set theSelectedMessages to selection
set the selected_message to item 1 of the theSelectedMessages
set message_id to the message id of the selected_message
set message_url to "message:%3C" & message_id & "%3E"
set TheSubject to the subject of the selected_message
set theBody to "[url=" & message_url & "]From: " & the sender of the selected_message & " - Subject: " & TheSubject & "[/url]"
tell application "Things"
show quick entry panel with properties {name:TheSubject, notes:theBody}
end tell
set currentMailbox to the mailbox of the selected_message
set currentAccount to the account of the currentMailbox
set filedMailbox to "All Mail"
move selected_message to mailbox filedMailbox of currentAccount
end tell

no comment

7

Sep

Things Mail Script

Posted by Rick  Published in Apple, Quicksilver, Things, scripts

ThingsRecently I have been trying to be more focused on the stuff that I need to get done. Just like everyone, I have email, phone calls and such that lead to things that I have to get done. I seemed to be doing ok with most of them, but emails were getting lost in the sea of stuff that I received every day. I read this post from Michael Hyatt and thought that I would give inbox zero a try.

So to get to inbox zero I had to employ some tools to help make this happen. The rule is that if you can deal with the email within two minutes, just get it done. If not then it becomes a task. OS X doesn’t really have any good tools to handle tasks and nothing at all that would sync with the iPhone. I don’t want to go into the details of of my choice, but I ended up with Things on the desktop and iPhone.

I’m a distracted person and for me to keep up with a system it has to be easy. I quickly get frustrated by software not being integrated so I go back to my same old ways. If this was going to be successful I would need to implement some apple scripts. Two keystrokes is what I needed. If I had handled the email I need a command to move the message to my “All Mail” folder and if not another command to create the task. Things has extensive Apple scripting support so I was on my way. I found some sample code in the Things Wiki and modified it to suit my needs. I will put the code for the scripts at the bottom of this post.

Come to find out the scripting was the easiest part of this project. It was harder to find a way to run the script from a keystroke. During my research I keep coming up with MailActOn which I downloaded and it did the trick, but I just couldn’t bring myself to purchase it. The only feature I needed was the keystroke mapping and thought there had to be an open source solution to my problem. After digging deeper into Google, I found out that the swiss army knife of Mac software, Quicksilver, could solve my problem. I’m not going into the detail of how to set it up in this post, but with a little research I was up and running.

I have been working with this solution for about a month and so far I have really liked it. Of course the scripts only work on my laptop and not on the iPhone, but with copy and paste in iPhone 3.0 I have survived. I hope that the Things people add a way to create a to do from a mail message on the iPhone.

Move Message To “All Mail” Folder Script:
At some point I’m going to update this script to move multiple selected messages, but right now it only moves one.

tell application "Mail"
set theSelectedMessages to selection
set the selected_message to item 1 of the theSelectedMessages
set currentMailbox to the mailbox of the selected_message
set currentAccount to the account of the currentMailbox
set filedMailbox to "All Mail"
move selected_message to mailbox filedMailbox of currentAccount
end tell

Create A To Do And Move The Message To “All Mail” Folder Script:
tell application "Mail"
set cr to ASCII character 13 -->You can probably use the Unicode Equivalent but I didn't know it and this worked right away.
set LF to ASCII character 10 --> Same as here
set carriage_return to (cr & LF as Unicode text)
set theSelectedMessages to selection
set the selected_message to item 1 of the theSelectedMessages
set message_id to the message id of the selected_message
set message_url to "message:%3C" & message_id & "%3E"
set TheSubject to the subject of the selected_message
set theBody to "[url=" & message_id & "]From: " & the sender of the selected_message & " - Subject: " & TheSubject & "[/url]"
tell application "Things"
show quick entry panel with properties {name:TheSubject, notes:theBody}
end tell
set currentMailbox to the mailbox of the selected_message
set currentAccount to the account of the currentMailbox
set filedMailbox to "All Mail"
move selected_message to mailbox filedMailbox of currentAccount
end tell

no comment

Search

Flickr Photos

IMG_0321IMG_0323IMG_0325IMG_0322IMG_0303IMG_0302

Flickr Photos

  • Grabbing lunch and then getting to work. — at Tornado Burger http://gowal.la/s/ZX4 36 mins ago
  • Getting everything ready for Sunday. — at Sugar Creek Baptist Church http://gowal.la/s/cZ8 5 hrs ago
  • Sunday is coming and glad that it is. 6 hrs ago
  • Glad to be home. Back to it tomorrow, getting ready for Sunday services. 14 hrs ago
  • Man, God really hazed up Sugar Land tonight. 15 hrs ago
  • More updates...

Posting tweet...

Categories

  • 3d (1)
  • Apple (7)
  • audio (15)
  • Blender (1)
  • changes (6)
  • Church (1)
  • lighting (11)
  • MacHash (1)
  • Open Source (3)
  • OS X (9)
  • Quicksilver (1)
  • Random Thoughts (13)
  • Repairs (2)
  • scripts (3)
  • Sundays (7)
  • Technical Production (38)
  • Things (3)
  • Uncategorized (4)
  • video (7)
  • Volunteers (6)

Archives

  • February 2010 (1)
  • October 2009 (1)
  • September 2009 (3)
  • August 2009 (1)
  • March 2009 (1)
  • February 2009 (2)
  • January 2009 (1)
  • December 2008 (2)
  • October 2008 (1)
  • September 2008 (1)
  • August 2008 (3)
  • July 2008 (6)
  • June 2008 (2)
  • May 2008 (10)
  • April 2008 (4)
  • March 2008 (9)
  • February 2008 (9)
  • January 2008 (5)

Blogroll

  • Brandon Riley
  • John Austin

Meta

  • Register
  • Log in
  • Main Entries Rss
  • Comments Rss
March 2010
S M T W T F S
« Feb    
 123456
78910111213
14151617181920
21222324252627
28293031  

Recent Post

  • Use any tool for the job.
  • Update to the Move Mail Applescript
  • Error in Things Todo Script
  • Things Mail Script
  • Unitaskers
  • Blender
  • iPhone 3.0
  • Panasonic AV-HS400A
  • Wall Projection
  • Wordpres iPhone Application test

Recent Comments

  • jraugustine in iPhone
  • Used Corvette in ProPreseter and a Free Motion Background
  • Gutiar Priase | Console Gaming in Gutiar Priase
  • zekesauce in Why do I like Safari so much?
  • Recent Faves Tagged With "saver" : … in ProPreseter and a Free Motion Background
  • Rick in ProPreseter and a Free Motion Background
  • radiantfirst in ProPreseter and a Free Motion Background
  • radiantfirst in Windows
  • Rick in Creating Successful Sundays - NASCAR Style Prepara…
  • John in Creating Successful Sundays - NASCAR Style Prepara…
© 2007 RickRussell.org
Theme by Wired Studios, courtesy of Corvette Garage modified by Rick Russell
Valid XHTML | Valid CSS 3.0
Powered by Wordpress