Thank you for writing this script.
We will support AppleScript in the future versions and make it possible to obtain current information from emails or browsers which support Script
Shall you need any help or have additional questions, please feel free to contact us. :)
as the question was asked on another thread and as I had a solution for my own workflow I thought I'd make a more or less "clean" version and share it.
Feel free to try it, comment on it and suggest additions/modifications.
What is it :
It's an Applescript that :
• extracts the key information from the currently selected Mail message(s)
• opens up a new task creation window in Doit.im
• fills the Task title, the Notes section, tag, context and project
• auto-saves it (this is an option)
The task title contains the sender/receiver of the mail message and the mail subject (can be adjusted within the Header section of the Applescript)
The task note contains the "text" version of the email body as well as a "hyperlink" back to the original mail message on the first line.
How to use it :
The most comfortable way is to assign a global hotkey to that script. There are quite a number of free and of course paid apps that allow that. Personally I use Alfred with the power pack extension. However, you may also have a look at BetterTouchTool.
In that case, just highlight the email(s) in Apple Mail and launch the script via the assigned Hotkey.
Another option would be to copy the script to your script library (../users/<your profile>/Library/Scripts) and afterwards activate the script menu everywhere from within the Applescript Editor Preferences. In that case you only need to select your email and then the script from within the Applescript menu.
Personalize it :
The first part of the script contains a certain number of properties that can be adjusted. They look like this :
ptyThisProperty: value
Those values may be adjusted according to your personal needs. They allow the following :
• Set default Tag/Context/Project
• Truncate the message body
• Set correspondent as Tag/Context/Project or add it to the task title
• Activate Auto-Save (with Auto-save on you can select multiple emails at the time and each will create a new task)
• ….
Some final remarks :
• If you have trouble with permissions, … you could try to open the script with the Applescript Editor, copy all of the script, paste it to a new empty script and then compile and save that newly created script.
• As mentioned above, this is a work in progress script I made for my personal needs, so it might not work for you (the way you'd like it to). Feel free to come back to this thread and ask for help.
• This script uses GUI Scripting to access and "control" the Doit.im app. This means that any future update of Doit.im might break things. If it does, let me know and I'll try to fix it. Hopefully, in the future, Doit.im app will support Applescript or an API will be available to replace this script by something more "professional".
Last but not least the link to download the script : http://bit.ly/18l6z1t
Bye,
Lutz
-
05/01/2013 10:17#1PRO
-
05/24/2013 07:03#2PRO
Dear Lutz - many thanks for a great script. Question for you: when I send an email into Doit using your script, the hyperlink doesn't look right, and doesn't work...so I get something like this (see first screen shot) creating an error message like the one in my second screen shot.
Love to know your thoughts.
Cheers,
Jon
-
05/26/2013 11:37#4PRO
Hi Jon,
Sorry to hear that it doesn't work for you.
As far as the link format is concerned, it looks correct to me.
I had a problem some time back where hyperlinks didn't work any more. In my case it was due to an Apple Mail Add-On (MailTags I think).
Could you please try the following :
- Open a new TextEdit document
- Drag your email to the TextEdit document
You should now see an Hyperlink in TextEdit
- Click on that link to see if your original email opens in Apple mail
If it does :
- right click on the hyperlink in TextEdit, choose modify hyperlink from context menu
- compare that hyperlink shown in the pop-up window to the one in Doit.im
There are some differences that are normal, like :
- "<" being replaced by %3C
- ">" being replaced by %3E
- missing slashes "/"
other than that, it should be identical.
Also, feel free to contact me directly via email (see script header for email address) as this forum does not send out notifications for new messages on the topic.
Bye,
Lutz
-
07/20/2013 12:10#5PRO
This is a private comment.
-
09/06/2013 21:04#6PRO
Hi,
I tried using this script and got the following error:
error "System Events got an error: Can’t get window 3 of application process \"Doit.im\". Invalid index." number -1719 from window 3 of application process "Doit.im"
I don't know enough about the coding to try and adjust that. I thought maybe someone could help. Thanks everybody. -
09/07/2013 05:57#7PRO
@JoshuaWilson
Hello,
You may use the "@XXX" form to let the author know the problem you encountered and thus he will receive the message. :) -
09/07/2013 19:19#8PRO
@LuMe96
Hey sorry I forgot to tag you in my earlier post. Hope you can take a look. -
11/09/2013 09:47#9PRO
Why is this thread always sitting at the top of the Features forum?
Maybe it would be a good idea to have a "Tips & Tricks" forum where users can share their experiences? -
11/10/2013 05:57#10PRO
@Folke
Hi,
Q:Why is this thread always sitting at the top of the Features forum?
A:We want to provide users a trick.
Q:Maybe it would be a good idea to have a "Tips & Tricks" forum where users can share their experiences?
A:It is a great idea. We are going to add this. Now you'd better join the Groups and discuss in the group. -
12/27/2013 20:14#11PRO
doit.im Version 4.0 breaks this script approach for me - and results in doit.im minimizing in slow motion when i execute.
I have uninstalled doit.im 4.0 and reverted back to Version 1.6.22 (13100911)
@ LuMe96 - many thanks for the original script, it is a huge benefit to doit. -
01/13/2014 09:22#12PRO
@headstrongpete
Hi,
Do you mean that you can not use this script approach in the Mac V4 app? -
01/13/2014 15:23#13PRO
@ Wendy_only, yes. I am not able to use the script approach with the Mac V4 app. Could just be me, as no one else seems to be discussing it.
-
01/15/2014 07:45#14PRO
@headstrongpete
Hi,
It is shared by @LuMe96. I will help you contact with him to give you a hand. -
01/17/2014 15:19#15PRO
I installed the 4.03 app again and ran the MailToDoit.scpt directly from within the script AppleScript Editor and the following error was returned.
error "System Events got an error: Can’t get text field 5 of window 1 of application process \"Doit.im\". Invalid index." number -1719 from text field 5 of window 1 of application process "Doit.im"
The script line that highlighted is "set value of text field 5 of window 1 to theTaskTitle --Title"
-
01/27/2014 01:07#16PRO
@headstrongpete
did you get this working, i'd love to have this option in Doit.im. It would be nice if it could automate sending selected emails into Doit and send a copy of that email to a folder called "Archive". Then in Doit I could decide whether to process or complete it now.
I have a similar scripte for sending emails to evernote that I downloaded off of a forum, but I have no idea how it works. -
02/05/2014 08:52#17PRO
Hi all,
sorry, I haven't been around for some time. Unfortunately this forum does not allow "subscription" so I wasn't aware of issues (have been trying another task manager for some time).
I'll have a look at my script and will try to modify it to work with 4.0.
Will keep you posted. -
02/05/2014 09:31#18PRO
@headstrongpete
@wendy_only
@Folke
@JoshuaWilson
@michelle1987
@jon_satterley
Hi all,
ok, I took a look at the changes in v4. In order to make the script working, you'll need to do a slight modification to it.
2 options :
1) Download the modified script from link in my opening post
2) Do the modification yourself
How to modify the script :
- open the script in the Applescript editor
- find the following lines (in the bottom half) :
-- click New Task button
click button 6 of window "Doit.im"
- change as follows (only need to replace the "6" by "7") :
-- click New Task button
click button 7 of window "Doit.im"
- save the script
That's all.
If you need help, please contact me by email (see the header of the script) or tag me @LuMe96 in your reply to this thread.
Bye. -
02/20/2014 09:02#19PRO
Hi,
I receive the message that i have selected more than one message all the time, even i have only one selected.. do you know how to solve that?
thanks so much -
02/20/2014 09:51#20PRO
The thing that really irritates me in Do.It mac is the fact that when you press RETURN when adding a task, it doesn't add the task. What's more, focus does not move to the SAVE button when you press TAB which means ....
EVERY time you add a task, you have to navigate with the MOUSE to the "Save" button and that's ... just very unproductive if you use a keyboard for speed.
@LuMe96, your script is brilliant - so thank you. A couple of questions:
1) Can you help to overcome this "return doesn't work" limitation?
2) Is it possible to modify the (I can try if you suggest a way) to put the URI of the message in the notes (so that you can hit the link and go back to Mail?). Things for Mac does this and it's a really useful feature.
Best wishes
DJ -
02/20/2014 09:55#21PRO
@LuMe96
Ignore question 2!. It didn't appear to do this on my first attempt, but I've relaunched DoIt.IM and it works as expected. I wonder if I didn't save the new task properly. Apologies.
Sorry for being an idiot!
Thanks again for a very useful script.
DJ -
02/20/2014 19:18#22PRO
@Jorge_op
Are you sure you only have one email selected?
This happens quite often in discussion mode. Selecting one message in the middle column of mail does select all messages of this discussion. You need to expand the discussion and select only one message in the developed message thread.
Other than that I don't see.
There is an option in the script to accept multi message selection. You can switch that on and see what tasks are created. -
02/20/2014 19:31#23PRO
@doctordjbrown
Ok for question 2: the link back to the mail message should be there and should work.
For question 1: I might be able to set focus to the save button after filling in the "new task window" with my script. I'll have a look at this tomorrow.
However I won't be able to change the general behavior of Doit im. -
02/24/2014 10:05#24PRO
@LuMe96
I've tried again this morning and at first i had the same problem but after restart mail and doit.im, i made it work.
thanks so much! -
10/13/2017 06:33#25PRO
I just stumbled over this thread and the dropbox-link isn't working any more. Can anyone post the AppleScript code again?
Thanks and all the best,
Steffen