I have been importing email messages from Outlook into DTPO and the syncing to DTTG. Messages that I import from within DTPO using FILE > IMPORT > EMAIL display just fine in DTTG. Messages that I import from within Outlook using the script below display fine in DTPO but in DTTG they display as html code (sometimes garbled). I can’t find any differences in the files to explain the difference. Anybody know what’s going on?
THE SCRIPT
-- Import selected Microsoft Outlook messages to DEVONthink Pro.
-- Created by Christian Grunenberg on Dec 08 2010.
-- Copyright (c) 2010-2015. All rights reserved.
-- this string is used when the message subject is empty
property pNoSubjectString : "(no subject)"
tell application "Microsoft Outlook"
try
set theSelection to the selected objects
if theSelection is {} then error "One or more messages must be selected."
tell application id "DNtp"
if not (exists current database) then error "No database is in use."
set theGroup to preferred import destination
end tell
repeat with theMessage in theSelection
try
set theSubject to subject of theMessage
set theSender to sender of theMessage
set theSender to (address of theSender) as string
set theSource to source of theMessage
set theDateReceived to time received of theMessage
set theDateSent to time sent of theMessage
if theSubject is equal to "" then set theSubject to pNoSubjectString
set theCategories to {}
set theList to (category of theMessage)
repeat with theCategory in theList
set theCategories to theCategories & (name of theCategory)
end repeat
set isFlagged to true
if todo flag of theMessage is (not flagged) then set isFlagged to false
set isUnread to is read of theMessage
tell application id "DNtp"
set theRecord to create record with {name:theSubject & ".eml", type:unknown, creation date:theDateSent, modification date:theDateReceived, URL:theSender, source:(theSource as string)} in theGroup
if theCategories is not {} then
set theTags to tags of theRecord
set theTags to theTags & theCategories
set tags of theRecord to theTags
end if
end tell
end try
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "Outlook" message error_message as warning
end try
end tell