Thanks, Korm and Berndm.
This post will be very long and detailed, so thank you to anyone with the patience to read it. I’ve looked across the forums, after searching “mail” and “mountain lion” and I can tell that I am not the only one having this issue, although people have described it in various ways, it appears likely to be the same problem. So, here are the details as best as I can provide them [and thanks again to anyone who can get through this!]
Fortunately, prior to updating DTPO and updating from Lion to Mountain Lion, I made a bootable clone on an external hard drive. Therefore, this afternoon, I booted up, from my prior system using the clone. It was sad, because my poor clone system did not know that it was only a ghost, and acted like it was still alive – reminded me of Dixie Flatline from Neuromancer or maybe Idaho from one of the later Dune books.
Anyway, Mail client clone started sucking-in mails that it had missed whilst being dead, and started faithfully shooting copies of them to DTPO, which received them in the in-box. Thus confirming that everything worked right before updating.
My observation summary observation is that – in the current system (Mountain Lion and DTPO 2.6.1) when in Mail>Preferences>Rules, and you specify RunApplescript, it will ONLY allow you to point the rule to a specific script that traces directly to a file with an .scpt file ending. Previously, in Lion and DTPO 2.5.x the rule pointed to a whole “package”, which included a script as one portion of it. So, something has changed, and whatever that “something” is, does not allow the rule to function as it did previously.
More specifically about my observation within the old clone [where the rule works], I went to Mail preferences and looked up the pertinent rules, [which allowed the emails to shoot over to DTPO automatically as they came into the Mail client]. The “Rules” interface allowed the user to specify by free hand, the location of the script [or package as it turns out] to which you wanted to call (whereas in mountain lion and new Mail, it forces you to “select” an available script.
Still in the clone, in Mail>preferences>rules, the old rules looked as follows, and pointed to the “script” as follows:
Description: [Rule 1]
If [any] of the following conditions are met:
[Sender is in my Address Book]
Perform the following actions:
[RunAppleScript][~/Library/Application Support/DEVONthink Pro 2/ExtraScripts/Mail/Mail Rule Action Import.app]
Description: [Rule 2]
If [any] of the following conditions are met:
[Sender is not in my Address Book]
Perform the following actions:
[RunAppleScript][~/Library/Application Support/DEVONthink Pro 2/ExtraScripts/Mail/Mail Rule Action Import.app]
Notice, that the location of the script is different than in the current version. [New location appears to be:Library>Application Scripts>com.apple.mail>[several script options at the bottom level].
Also different, is that in the old system, when I use finder to navigate to said “Mail Rule Action Import.app” it is not really just a script but, is a “package” that contains a script along with other stuff. Remember, this is the old version that actually worked. Looking inside the package, it looks like this: [see attached screen shot at bottom of post, please].
The script portion within the package titled “main.scpt” has the following content:
– Mail Rule Action Import to DEVONthink Pro.
– Created by Christian Grunenberg on Mon Apr 19 2004.
– Copyright © 2004-2009. All rights reserved.
– this string is used when the message subject is empty
property pNoSubjectString : “(no subject)”
using terms from application “Mail”
on perform mail action with messages theMessages for rule theRule
tell application “Mail”
repeat with theMessage in theMessages
my importMessage(theMessage)
end repeat
end tell
end perform mail action with messages
end using terms from
on importMessage(theMessage)
tell application “Mail”
try
tell theMessage
set {theDateReceived, theDateSent, theSender, theSubject, theSource, theReadFlag} to {the date received, the date sent, the sender, subject, the source, the read status}
end tell
if theSubject is equal to “” then set theSubject to pNoSubjectString
tell application id “com.devon-technologies.thinkpro2”
set theRecord to create record with {name:theSubject & “.eml”, type:unknown, creation date:theDateSent, modification date:theDateReceived, URL:theSender, source:(theSource as string)} in incoming group
set unread of theRecord to (not theReadFlag)
end tell
end try
end tell
end importMessage
If anyone has any idea of how to solve this problem; or maybe just a comment that will enlighten me a bit more about relevant aspects of DTPO and scripting and OSX, I’d appreciate the thoughts.