creating indexed note,RTF, etc. to HDD

In an effort to keep all of my files in DT indexed and residing on my HDD in my own structured folders, is there any way to create a note or document (RTF, etc.) in DT and have it saved on my HDD rather than in DT database folder structure? How about Web links?

Most of my databases are 100% indexed and I get around this issue by attaching a full-sync script to each top-level group. Every time I select the top group, any documents/folders that were added in the Finder will be indexed into the database, and any documents/groups that were added in DEVONthink will be exported to the Finder.

Here is the script-I believe korm is the original author.

on triggered(theRecord)
		tell application id "com.devon-technologies.thinkpro2"
			deconsolidate record theRecord
			synchronize record theRecord
		end tell
	end try
end triggered

I dropped the Script in the ~Library-Scripts-Folder Action Scripts folder, but how do I actually run it on a test note I just created in DT? When clicking on my Group folder in DT, I don’t see any new files created on my HDD in that particular folder.

Also, is it possible for the Script to delete the original Doc created in DT after exporting it to my HDD?

The script can be anywhere on your hard drive, and should be somewhere other than the folder actions scripts folder so that it is not applied to a Finder folder inadvertently. To attach it to an indexed group in DEVONthink, select the group, bring up the info panel (command-shift-i), click on ‘Select’ to the right of the script field, and navigate to where the applescript is saved to the hard drive.

Thank you. The only thing now is, how do I get that file automatically deleted in DT. I’d rather not have duplicates when I create a file in DT. I want to keep all the files on my HDD.

I think I got it. I recreated a note and it’s only showing on my HDD. Thanks again.

Can such a Folder Action Script be attached to an entire database?
Also, can you select more than one folder (Group) at a time and attach the Script? Or should it be done one at a time?

Another question. Is there another Script for when I create a New Group (folder) in DT to where that folder will be created on my HDD? Maybe I’m expecting too much with DT as a Finder replacement in this case.

They are not Folder Actions. They are attached scripts. Though similar, Folder Actions belong to the filesystem, not part of DEVONthink, and are triggered when something is added to the folder that has one or more Folder Actions. The DEVONthink manual explains attached scripts thus:

Scripts cannot be attached to databases. Just groups.

Multiple groups at a time - or one group at a time - both actions will work.

It could be written. (IMO, it would be tricky to get it right with proper error checking.) But why do it?

Yes, you are. :open_mouth: DEVONthink is not a Finder replacement - it is a database with document and content management features.

Thank you. I’m enjoying getting to know DT.

I’ve applied the Script to the Top folder I dragged over as a Group. For some reason, when adding a note in DT to a subfolder in the Top folder, the note went into the DT database and not to my HDD. Am I doing something wrong here? Do I need to attach that script to subfolders as well?

When you add new note, it will first show up in the database. To trigger the script (and send the document to the external folder and make it an indexed document) you need to click the “Top folder” where you attached the script. That’s the way these attached scripts work - select (i.e., click) the group that has the script attached. By design, they don’t work without that step.

Thought I did that, but yes, it works now. Thanks.

I’ve been rearranging my Folder structure of files since I’m indexing everything. I know DT can make sense out of it all, but I’d like something more logical in my own Folder structure. Looks like I’ll be nesting Folders a bit more.

A question about emptying the trash in DT. I notice that, after indexing, if I choose Files and Folders on emptying the trash, I will lost those on my HDD. So, I choose Database instead. What about when deleting Databases? I assume all the indexed files on my HDD are safe.

It’s been working good for me until I just went into my Finder and found that the files I dragged into a different Group folder in DT are showing accurately in DT but not in the Finder. I clicked on the Group Folder which I have the Script assigned to, but the files in the Finder are not actually being moved. They’re just showing as being moved in DT.

That it the expected behavior-DEVONthink isn’t going to move files around to different folders in the Finder just because they were moved to a different groups in the database. Likewise, if you replicate documents to different groups in the database, those replicants will also not appear in different folders in the Finder.

If you want to physically move documents in the database and also have that change made in the Finder, you’ll need to:

  1. import the documents into the database (right-click, Move Into Database)

  2. move them to their new location in the database, and (assuming the new location is an Indexed group)

  3. export the documents back out (right-click, Move to External Folder).

OK. I thought I remember being able to move docs like that in the database and have it reflected in the Finder by having that script attached mentioned above.