Accessing backend files in shared databases, from multiple Macs?

Hi all,
First of all, thanks for this great forum and resource. I have used Evernote for ~8 years but my new work environment would not allow it, and I finally got to DEVONthink after 2 years of desperation with OneNote.

Here is my problem: I use Alfred to automate or facilitate tasks, and I wrote a little script to quickly append single lines (about things I need to do or remember) to various text files. This works perfectly with DEVONthink as I can access the backend text files.

However, I started syncing my desktop database on my laptop (via a local sync store located on a shared folder) and I can’t use my Alfred scripts as they are, as the path to those backend files is different on my laptop.

One solution is to have two separate sets of Alfred scripts (one for desktop and one for laptop) for each txt file, but I was wondering if there is a way to use the sync store to point to the backend file of a text note, uniquely across 2 devices?

Alternatively, is there a way to programmatically append text to a text file using its DEVONthink link (e.g. x-devonthink-item://xxxx) which is the same across devices?

Thanks in advance for your help!!

Hi @gi0vanni,

what do you mean by backend files?

There is. You just have to use an Applescript. In Alfred, it would look something like this:

on run
tell application id "DNtp"
	set theRecord to get record with uuid "{query}"

{* do what you have to do here* }

end tell
end run

Once you have theRecord defined you can do pretty much anything.

1 Like

Thank you @Bernardo_V! Super helpful.
Yes, by backend I just meant the txt files underlying a note (which have paths like …/Databases/myDatabase.dtBase2/Files.noindex/txt/a/nextMeeting.txt).
Thanks again

1 Like

You’re welcome :slight_smile:

Note: It is unwise to use the internal paths of DEVONthink files as they could change and break things. (Also, we do not advocate messing about in the internals of a database unless instructed to by us.)

1 Like

got it! :slightly_smiling_face:

You’re welcome