Is there a way to emulate the Evernote's excellent filing system via Apple Mail?

“Ich bitte Sie”, as DeepL would say :wink:

3 Likes

An alternate…

tell application id "DNtp"
	activate
	set groupList to {}
	tell current database
		set tablist to {}
		set parentList to (parents whose (location is "/") and (type is not smart group))
		if parentList ≠ {} then
			show progress indicator "Building directory listing"
			repeat with thisParent in parentList
				set parentName to (name of thisParent)
				step progress indicator parentName
				if parentName is not in {"Tags", "Trash", "Annotations"} then
					copy (parentName & return) to end of groupList
					my processChildren(thisParent, groupList, "")
				end if
				copy return to end of groupList
			end repeat
			set listingDoc to create record with {name:(name as string), content:groupList as string, type:text} in incoming group
			step progress indicator "Listing finished."
			delay 2
			hide progress indicator
			open window for record listingDoc
		end if
	end tell
end tell

on processChildren(thisParent, groupList, tablist)
	tell application id "DNtp"
		set theChildren to (children of thisParent whose (type = group))
		repeat with thisChild in theChildren
			copy ((tablist & (ASCII character 9) & "--> ") & (name of thisChild) & return) to end of groupList
			step progress indicator (name of thisChild as string)
			my processChildren(thisChild, groupList, tablist & (ASCII character 9))
		end repeat
	end tell
end processChildren
1 Like

thank you. Is there a way to exclude subgroups ?

Why would you want to exclude subgroups if you want a full directory listing?

1 Like

because of this problem which affects all users who migrate from evernote to DevonThink

Retranscribed from above

I finally understand the problem.
When you import EN → DT, EN Notes containing PDFs are bundled into a group consisting of 2 files: a PDF and an HTML file, so that there are a gazillion subgroups.
I therefore have to eliminate subgroups.

Wow, wasn’t aware that parents includes Smart Groups. Updated both scripts again :sweat_smile: Thanks!

Do you want to ungroup these? Please post a picture of your group structure, including more than one subgroup.

thank you for the suggestion.
I could not. Each subgroup is in fact a bundle, ie ONE single imported evernote note which DevonThink has subdivided into multiple DevonThink documents and bundled in a minigroup which can contain 2 or much more (6+) documents.
I am surprised that this is not widely discussed in this forum, although it may have
My workaround takes 2 minutes and works perfectly.
Do you use typinator ?

I have completely no idea what that means. DEVONthink only knows groups, there are no such things as “bundle” or “minigroups”. If you had posted a picture as requested then I could see what it looks like, however if you don’t want to get your problem solved that’s also fine for me.

Yes, I use Typinator.

1 Like

It’s fine. thanks. I solved my problem. I think that we don’t understand each other. Obviously there are only groups in DT. The terms bundle and mini groups were simply mental imagery to explain the situation.

As far as this point is concerned, I am not asking a question. I am pointing out a problem with Evernote import.

Example
DT → import a single evernote note which contains text + and image + a PDF → DT does not create a single document, it creates a GROUP containing 10 items, so if you import 10,000 notes from Evernote, you don’t end up with 10,000 DT docs distributed in DT Groups (= Evernote notebooks), you end up also with a gazillion subgroups created by the process above.

I think that this is because DT imports as HTML. IF the EN → DT import process had converted evernote notes to RTF, you would not have this problem.

@BLUEFROG to avoid this messy situation, would there have been any way to import evernote as RTF ?

@rufus123 I asked you whether you could post a picture in order to let me understand what the problem is. You didn’t post one.

Instead you’ve chosen to use “mental imagery to explain the situation”. I never used Evernote and never did an Evernote import in DEVONthink. How do you think “mental imagery” could help someone like me to understand what you are writing about?

Now you’ve posted a picture but you didn’t

I’ve still no idea what exactly the problem is, and how you think it should be.

Even if you’re not interested in solving it - or maybe not in how I would try to solve it - I’m still curious what you want the outcome of an Evernote import to be.

3 Likes

OK. thanks again very much for your help. Let’s leave it at that for the moment.

I posted a script that saved you from writing 500 Smart Rules. Afterwards you requested a script that gets you the group names. I posted this too.

However you are not willing to post a simple picture that I requested.

I see now how

works for you.

1 Like

I don’t understand. I posted the image above.

I too am trying to replace Daylite with a good Email forwarding from Apple Mail TO and FROM so that I Can duplicate the Daylite structure of Company, Employee, Email attached.

In Daylite you can search a person and see all the person’s emails and also all the company emails and notes etc etc. A scripping solution would be wonderful, I got off Daylite as I do not like Cloud solutions.

@pete31 BTW I agree you have given a great amount of feedbask a picture was simply courtesy in response.

Devonthink is not a cloud service, so no mail forwarding

i have a Devonthink mail folder, which stores any mail to be stored in Devonthink
A mail rule automatically directs mail to this folder
An applescript automatically imports the email to Devonthink
with the sender identified by a tag

I can see a sender’s email via the tag

structure of Company, Employee, Email attached.

The tags can be structured