The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Using ReQall.com to get tasks into OmniFocus (http://forums.omnigroup.com/showthread.php?t=8735)

whshep 2009-04-26 05:59 AM

Okay, I think I've got this running now

The Context setter line has to read:

set taskContext to context "ReQall" [B][I]of default document[/I][/B]

Also, to process the inbox automatically, add this line before the last "end tell"

compact default document

What I don't understand is why I kept getting a compiler error when I first tried to add these lines.

And I still don't understand the need for the line:

set theContext to context "Home Office" of context "Work" of first document

Thanks to everyone for their help!

dbyler 2009-11-03 09:36 PM

This doesn't add anything new for those who have a running reQall script... but here's the whole thing ready for copy-paste (incorporates comments from this thread).

In its current state it doesn't assign a context, but if you want to do that just uncomment as indicated.

[CODE](* Modified "Jott to OmniFocus" modified by dbyler to work with reQall mail. *)
-- Derived from work that is Copyright © 2007, Curtis Clifton All rights reserved.
-- Modified to work specifically with Jott messages.
-- See http://forums.omnigroup.com/showthread.php?t=7651

-- If true, then the sender of the message is included in the action's description.
property includeSender : true
property messageSender : "reQall"

on run
tell application "Mail"
set selectedMessages to selection
if ((count of selectedMessages) ≠ 1) then
display alert "Please select a message to be linked to the new action" message "This script creates a new OmniFocus action that links back to a selected message." buttons {"OK"} default button "OK" giving up after 20
return
end if
my process_message(item 1 of selectedMessages)
end tell
end run

using terms from application "Mail"
on perform mail action with messages theMessages
try
set theMessageCount to count of theMessages
repeat with theMessageIndex from 1 to theMessageCount
my process_message(item theMessageIndex of theMessages)
end repeat
on error m number n
tell application "OmniFocus"
log "Exception in Mail action: (" & n & ") " & m
end tell
end try
end perform mail action with messages
end using terms from

on process_message(theMessage)
tell application "Mail"
set theContent to source of theMessage
set theDate to date sent of theMessage
set messageId to message id of theMessage
end tell

tell application "OmniFocus"
set messageStart to (offset of "Added to reqall:" in theContent) + 18
set messageEnd to (offset of "Edit this item at" in theContent) - 2
set taskName to rich text messageStart through messageEnd of theContent
if (includeSender) then
set taskName to taskName & " (via " & messageSender & ")"
end if
set theDoc to default document
--Uncomment next line if you wish to set default context. Context must exist first.
--set taskContext to context "reQall" of default document
tell theDoc
-- Delete the next line, uncomment the next one if you wish to set default context
set propRecord to {name:taskName}
-- set propRecord to {name:taskName, context:taskContext}
set theTask to make new inbox task with properties propRecord
end tell
tell theTask
set start date to theDate
set note to return & return
tell note
set theURL to "message://<" & messageId & ">"
set linkText to theURL
insert linkText at before first character
set value of attribute "link" of style of paragraph 1 to theURL
end tell
end tell
end tell
end process_message
[/CODE]

train99 2009-11-09 06:11 AM

script location
 
[QUOTE=dbyler;69270]This doesn't add anything new for those who have a running reQall script... but here's the whole thing ready for copy-paste (incorporates comments from this thread).
[/QUOTE]

thanks for the script.. i have a very simple Mac question.. WHERE do i put that code? :)

thanks

whpalmer4 2009-11-16 12:38 PM

Fire up the Script Editor, which can be found in the Applescript folder in your Applications Folder. Paste in the code, then save it in Library/Scripts/Applications/OmniFocus (you'll have to create the OmniFocus folder) with some appropriate name. You can then install it as a toolbar button in OmniFocus, or invoke it from the Applescript menu (which you need to turn on if you want it with Applescript Utility, in that same folder), or invoke it from a Mail rule (what you'll want to do in this case).

pinkpanther 2010-02-10 03:11 PM

Script doesn't work right for me
 
Hi,

Thanks for the script, this looks like it could be very helpful. Unfortunately, I seem to be running into some problems: Basically, I created the script (following the instructions set within the comments of the script) and placed it in the AppleScript OmniFocus folder. When I run the script, however, I get mixed results -- some of the reQall email messages create a proper task in omnifocus, while other reQall emails create a huge garbled mess of a task. For example, earlier I set a reminder for myself and with the message selected in Mail.app I ran the applescript -- here is the resulting task created within OmniFocus:

[PHP]
t@reqall.com>
Received: from smtpin133.mac.com ([unknown] [10.150.68.133])
by ms212.mac.com (Sun Java(tm) System Messaging Server 7u3-12.01 64bit (built
Oct 15 2009)) with ESMTP id <0KXN000J9D6UTI20@ms212.mac.com> for
********@mac.com; Wed, 10 Feb 2010 14:30:30 -0800 (PST)
Original-recipient: rfc822;********@mac.com
Received: from mail.reqall.com ([72.32.189.34])
by smtpin133.mac.com (Sun Java(tm) System Messaging Server 7u3-14.01 64bit
(built Dec 27 2009)) with ESMTP id <0KXN00BG0D6U5G50@smtpin133.mac.com> for
**********@mac.com (ORCPT *********@mac.com); Wed,
10 Feb 2010 14:30:30 -0800 (PST)
X-Proofpoint-Virus-Version: vendor=fsecure
engine=1.12.8161:2.4.5,1.2.40,4.0.166
definitions=2010-02-10_16:2010-02-06,2010-02-10,2010-02-10 signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0
reason=mlx engine=5.0.0-0908210000 definitions=main-1002100193
Received: from qtechinc.com (97500-web1.qtechinc.com [192.168.1.34])
by mail.reqall.com (Postfix) with ESMTP id 190AF18738 for
<*******[edited]@mac.com>; Wed, 10 Feb 2010 16:01:08 -0600 (CST)
Date: Wed, 10 Feb 2010 22:01:08 +0000
From: reQall <post@reqall.com>
Reply-to: reQall <post@reqall.com>
To: *********@mac.com
Message-id: <74334b732ca4cb1c_d_pid_5035163@reqall.com>
Subject: Reminder for Feb 10, 2010 2:00 PM: remind me to open at 2:00pm
MIME-version: 1.0
Content-type: multipart/mixed;
boundary=mimepart_4b732ca41824c_649d..fdbfe3b6a3b0


--mimepart_4b732ca41824c_649d..fdbfe3b6a3b0
Content-Type: multipart/alternative; boundary=mimepart_4b732ca418763_649d..fdbfe3b6a4d4


--mimepart_4b732ca418763_649d..fdbfe3b6a4d4
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline



reQall reminder:

remind me to open at 2:00pm
http://www.reqall.com/webnew/webeditpost/5035163
Edit this item.


-----------------------------------------------------------------------
You can control or turn off reminder emails on the http://www.reqall.com/=
webnew/notifications reQall Settings page.
You can invite your friends to try reQall at http://www.reqall.com/web/in=
vite_multiple. =

If you're a reQall Pro user you can reply to this email (reQall &lt;post@=
reqall.com&gt;) to tell reQall how to mark this item. Use a one-word repl=
y at the top of the content area: done, delete, pending or help.
-----------------------------------------------------------------------
http://www.reqall.com






--mimepart_4b732ca418763_649d..fdbfe3b6a4d4
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ww=
w.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8" =
/>
<title>reQall</title>
</head>
<body style=3D" font-family:Helvetica, Verdana, Arial, sans-serif; font-s=
ize:10pt;">
=


<strong>reQall reminder:</strong><br/>

remind me to open at 2:00pm<br>
<a href=3D"http://www.reqall.com/webnew/webeditpost/5035163" target=3D"_b=
lank" style=3D"text-decoration:none; color: #0066FF;">
Edit this item</a><br /><br />
<hr size=3D"1" noshade=3D"noshade" color=3D"#E8E8E8" height=3D"1px"/>
<font style=3D"font-size:7pt;">
=

You can control or turn off reminder emails on the <a href=3D"http://www.=
reqall.com/webnew/notifications" target=3D"_blank" style=3D"text-decorati=
on:none; color: #0066FF;"> reQall Settings</a> page.
<br />You can <a href=3D"http://www.reqall.com/web/invite_multiple" targe=
t=3D"_blank" style=3D"text-decoration:none; color: #0066FF;">invite your =
friends</a> to try reQall. <br />
If you're a reQall Pro user you can reply to this email to tell reQall ho=
w to mark this item. Use a one-word reply at the top of the content area:=
done, delete, pending or help.

</font>
<hr size=3D"1" noshade=3D"noshade" color=3D"silver" height=3D"1px"/>
=

<font style=3D"font-size:7pt;"><a href=3D"http://www.reqall.com/" style=3D=
"text-decoration:none; color: #0066FF;">www.reqall.com</a></font>
</body>
</html>
=





--mimepart_4b732ca418763_649d..fdbfe3b6a4d4--

--mimepart_4b732ca41824c_649d..fdbfe3b6a3b0-- (via reQall)[/PHP]

Any help on what this means would be greatly appreciated. Also, exactly what do I have to set the mail rules to in the Mail.app in order for messages from reQall to automatically be filed into omnifocus? I can't seem to get that to work either.

Thank you so so much for your help!

PS - here is the applescript code I am using just in case that is needed:

[PHP]
(* Modified "Jott to OmniFocus" modified by dbyler to work with reQall mail. *)
-- Derived from work that is Copyright © 2007, Curtis Clifton All rights reserved.
-- Modified to work specifically with Jott messages.
-- See http://forums.omnigroup.com/showthread.php?t=7651

-- If true, then the sender of the message is included in the action's description.
property includeSender : true
property messageSender : "reQall"

on run
tell application "Mail"
set selectedMessages to selection
if ((count of selectedMessages) ≠ 1) then
display alert "Please select a message to be linked to the new action" message "This script creates a new OmniFocus action that links back to a selected message." buttons {"OK"} default button "OK" giving up after 20
return
end if
my process_message(item 1 of selectedMessages)
end tell
end run

using terms from application "Mail"
on perform mail action with messages theMessages
try
set theMessageCount to count of theMessages
repeat with theMessageIndex from 1 to theMessageCount
my process_message(item theMessageIndex of theMessages)
end repeat
on error m number n
tell application "OmniFocus"
log "Exception in Mail action: (" & n & ") " & m
end tell
end try
end perform mail action with messages
end using terms from

on process_message(theMessage)
tell application "Mail"
set theContent to source of theMessage
set theDate to date sent of theMessage
set messageId to message id of theMessage
end tell

tell application "OmniFocus"
set messageStart to (offset of "Added to reqall:" in theContent) + 18
set messageEnd to (offset of "Edit this item at" in theContent) - 2
set taskName to rich text messageStart through messageEnd of theContent
if (includeSender) then
set taskName to taskName & " (via " & messageSender & ")"
end if
set theDoc to default document
--Uncomment next line if you wish to set default context. Context must exist first.
set taskContext to context "reQall" of default document
tell theDoc
-- Delete the next line, uncomment the next one if you wish to set default context
set propRecord to {name:taskName, context:taskContext}
set theTask to make new inbox task with properties propRecord
end tell
tell theTask
set start date to theDate
set note to return & return
tell note
set theURL to "message://<" & messageId & ">"
set linkText to theURL
insert linkText at before first character
set value of attribute "link" of style of paragraph 1 to theURL
end tell
end tell
end tell
end process_message[/PHP]

nicmalone 2010-03-14 10:37 AM

FAO: Pinkpanther: Getting rid of gibberish
 
1 Attachment(s)
I'm no expert on AppleScript but the problem seems to be with the Mail rules and script trying to process the "Reminder" reQall. You only need the "Added" emails to be processed into OF actions (the reminders are just tha, reminders of the same info contained in the "Added" emails).
So, add a rule in Mail that says only process emails from [email]post@reQall.com[/email] whose subject line begins with "Added:".

I've attached a pic of the rules I use (I'm using the Script included in the above post - the one tweaked from JotNot)

petonic 2011-08-18 09:31 AM

Looks like it's a BASE64 MIME problem
 
[QUOTE=pinkpanther;73095]Hi,

Thanks for the script, this looks like it could be very helpful. Unfortunately, I seem to be running into some problems: Basically, I created the script (following the instructions set within the comments of the script) and placed it in the AppleScript OmniFocus folder. When I run the script, however, I get mixed results -- some of the reQall email messages create a proper task in omnifocus, while other reQall emails create a huge garbled mess of a task. For example, earlier I set a reminder for myself and with the message selected in Mail.app I ran the applescript -- here is the resulting task created within OmniFocus:

[PHP]
t@reqall.com>
Received: from smtpin133.mac.com ([unknown] [10.150.68.133])
by ms212.mac.com (Sun Java(tm) System Messaging Server 7u3-12.01 64bit (built
Oct 15 2009)) with ESMTP id <0KXN000J9D6UTI20@ms212.mac.com> for
********@mac.com; Wed, 10 Feb 2010 14:30:30 -0800 (PST)
Original-recipient: rfc822;********@mac.com
Received: from mail.reqall.com ([72.32.189.34])
by smtpin133.mac.com (Sun Java(tm) System Messaging Server 7u3-14.01 64bit
(built Dec 27 2009)) with ESMTP id <0KXN00BG0D6U5G50@smtpin133.mac.com> for
**********@mac.com (ORCPT *********@mac.com); Wed,
10 Feb 2010 14:30:30 -0800 (PST)
X-Proofpoint-Virus-Version: vendor=fsecure
engine=1.12.8161:2.4.5,1.2.40,4.0.166
definitions=2010-02-10_16:2010-02-06,2010-02-10,2010-02-10 signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0
reason=mlx engine=5.0.0-0908210000 definitions=main-1002100193
Received: from qtechinc.com (97500-web1.qtechinc.com [192.168.1.34])
by mail.reqall.com (Postfix) with ESMTP id 190AF18738 for
<*******[edited]@mac.com>; Wed, 10 Feb 2010 16:01:08 -0600 (CST)
Date: Wed, 10 Feb 2010 22:01:08 +0000
From: reQall <post@reqall.com>
Reply-to: reQall <post@reqall.com>
To: *********@mac.com
Message-id: <74334b732ca4cb1c_d_pid_5035163@reqall.com>
Subject: Reminder for Feb 10, 2010 2:00 PM: remind me to open at 2:00pm
MIME-version: 1.0
Content-type: multipart/mixed;
boundary=mimepart_4b732ca41824c_649d..fdbfe3b6a3b0


--mimepart_4b732ca41824c_649d..fdbfe3b6a3b0
Content-Type: multipart/alternative; boundary=mimepart_4b732ca418763_649d..fdbfe3b6a4d4


--mimepart_4b732ca418763_649d..fdbfe3b6a4d4
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
[/PHP]
[/QUOTE]

This is looking like it's a problem because ReQall is sending the emails in MIME format. This must've been a recent change from ReQall.

Does anyone have any idea on where to go from there? Is anyone using the above script and still able to decode their ReQall addition notifications?

petonic 2011-08-18 03:39 PM

Solution found for ReQall into OmniFocus
 
OK, I dug into some of the object model for Applescript (this language, from a structure and syntax perspective, sucks) and determined that the script above *almost* works. It's accessing the Message->RawContent instead of Message->Content, so it feeds you MIME instead of Rich Text. I've made a couple of changes, and this script now works for ReQall into OmniFocus. Couple of the numeric constants had to change because of the new text that ReQall sends back.

Let me know if there are any problems.

[CODE](*Modified "Jot to OmniFocus" again by petonic on 8/18/2011. *)
(* Modified "Jott to OmniFocus" modified by dbyler to work with reQall mail. *)
-- Derived from work that is Copyright © 2007, Curtis Clifton All rights reserved.
-- Modified to work specifically with Jott messages.
-- See http://forums.omnigroup.com/showthread.php?t=7651

-- If true, then the sender of the message is included in the action's description.
property includeSender : true
property messageSender : "reQall"

on run
tell application "Mail"
set selectedMessages to selection
if ((count of selectedMessages) ≠ 1) then
display alert "Please select a message to be linked to the new action" message "This script creates a new OmniFocus action that links back to a selected message." buttons {"OK"} default button "OK" giving up after 20
return
end if
my process_message(item 1 of selectedMessages)
end tell
end run

using terms from application "Mail"
on perform mail action with messages theMessages
try
set theMessageCount to count of theMessages
repeat with theMessageIndex from 1 to theMessageCount
my process_message(item theMessageIndex of theMessages)
end repeat
on error m number n
tell application "OmniFocus"
log "Exception in Mail action: (" & n & ") " & m
end tell
end try
end perform mail action with messages
end using terms from

on process_message(theMessage)
tell application "Mail"
set theContent to content of theMessage
set theDate to date sent of theMessage
set messageId to message id of theMessage

end tell

tell application "OmniFocus"
set messageStart to (offset of "Added to reqall:" in theContent) + 17
set messageEnd to (offset of "Edit this item." in theContent) - 2
set taskName to rich text messageStart through messageEnd of theContent

if (includeSender) then
set taskName to taskName & " (via " & messageSender & ")"
end if
set theDoc to default document
--Uncomment next line if you wish to set default context. Context must exist first.
--set taskContext to context "reQall" of default document
tell theDoc
-- Delete the next line, uncomment the next one if you wish to set default context
set propRecord to {name:taskName}
-- set propRecord to {name:taskName, context:taskContext}
set theTask to make new inbox task with properties propRecord
end tell
tell theTask
set start date to theDate
set note to return & return
tell note
set theURL to "message://<" & messageId & ">"
set linkText to theURL
insert linkText at before first character
set value of attribute "link" of style of paragraph 1 to theURL
end tell
end tell
end tell
end process_message

on write_error_log(this_error)
set the error_log to ((path to desktop) as text) & "Script Error Log.txt"
try
open for access file the error_log with write permission
write (this_error & return) to file the error_log starting at eof
close access file the error_log
on error
try
close access file the error_log
end try
end try
end write_error_log
[/CODE]

mikegibb 2011-10-03 07:14 AM

Didn't See This Covered
 
How do you invoke it from a mail rule?

[QUOTE=whpalmer4;69804]Fire up the Script Editor, which can be found in the Applescript folder in your Applications Folder. Paste in the code, then save it in Library/Scripts/Applications/OmniFocus (you'll have to create the OmniFocus folder) with some appropriate name. You can then install it as a toolbar button in OmniFocus, or invoke it from the Applescript menu (which you need to turn on if you want it with Applescript Utility, in that same folder), or invoke it from a Mail rule (what you'll want to do in this case).[/QUOTE]


All times are GMT -8. The time now is 07:15 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.