Apple mail script error selecting folder in database

Hi All
I have been successful in using the default mail script to automate adding emails from mail to DTP. I am now trying to modify the incoming apple email script, so that instead of the message being routed to the Global inbox, that it goes to a folder in my Sync folder

ie. i would like the rule to create an entry, from an email, into a database called Notes, and then into the Sync folder, and then a sub-folder called Incoming. ie.


looking through previous posts i tried to edit as follows:

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 child “Incoming” of child “Sync” of database “Notes”

But the script does not work. Any suggestions?
Many thanks