Indexed OneDrive folder updates

Hello. I saw a topic about exactly this issue when DT3 was still in beta, and I believe I am having the same issue now that DT3 has been released…

I have OneDrive with several hundred client folders that I have indexed in a database in DT3. If the folder has already been indexed in DT3, when I add a new file to that folder, the OneDrive folder is updated automatically. So far so good.

The problem becomes when I need to create a new folder (for a new client, for example). If I create that new folder within DT3, there doesn’t seem to be a way to get OneDrive updated, even when I manually choose to Update Indexed Items. That new folders is just not pushed out to the cloud. If I start in OneDrive, create the folder, and THEN manually update, that new folder will show up in DT3, but it seems like I shouldn’t have to do it that way.

As an FYI, when I had DT2, I had a script connected to the top-level folder (or maybe the database?) that would run when I clicked it, forcing the DT and cloud structures to be synced.



I don’t run OneDrive here but create the group in DEVONthink, Control-click it, and choose Move to External Folder. Does that work for you?

What’s the path of your OneDrive folder?

Move to External Folder does not show up as an option on Control-Click.

OneDrive is at my home root. However, under the root of OneDrive is a folder called Client Data. I don’t index that folder, as it’s annoying to have to access all 423 folders under that folder. So the way I index is to select Index Files and Folders, navigate to where I can open the Client Data folder, and then choose Select All to get all the folders at the “root” level of the DT3 database.

Now that I write this, I’m thinking this might be causing the problem. Is there any way to index properly without having to go through a high-level folder? It’s as if I would like to set the database itself to the same path as the Client Data folder…

The location (internal or external) of new groups depends on the parent group - if the new group is created outside an indexed group, then no folder is created in the Finder.

okay, thanks for the clarification.

Do you have a suggestion to get around the one high-level folder with 423 folders under it, so that I don’t have to always be digging two levels down?

One possibility might be a script which asks for the name and then creates & indexes the folder. A very basic script might look like this (no error handling, uses desktop folder and current group):

tell application id "DNtp"
	set theName to display name editor "Create new folder" info "Name"
	set theLocation to path to desktop folder
	tell application "Finder" to make new folder at theLocation with properties {name:theName}
	set theFolder to (theLocation as string) & theName
	indicate theFolder to current group
end tell

Thank you, but what does this script accomplish?

It allows you to create a new folder and have it indexed into DEVONthink. You’d just need to change the location variable.

Here’s a modified version…

tell application id "DNtp"
	set theName to display name editor "Create new folder" info "Name"
	set theLocation to ""
	-- Select the OneDrive folder in the Finder and press Command-Option-C to copy the path.
    -- Paste it inside the quotes for theLocation variable and add a single forward slash at the end.
	tell application "Finder" to make new folder at (theLocation as POSIX file) with properties {name:theName}
	set theFolder to (theLocation as string) & theName
	indicate theFolder to current group
end tell

Thank you!

You’re welcome.

Do note you can save this in the ~/Library/Application Scripts/com.devon-technologies.think3/Menu or Toolbar folder for running it as needed.
If in the Toolbar folder, quit and restart DEVONthink, then Control-click the toolbar and choose Customize Toolbar. Drag the script to the toolbar and you can click the button to run it.

1 Like

Hi. I have been using this script since December when you posted it, without incident. All of a sudden today it just stopped working. Any thoughts about what happened or how to fix?

What is reported in Window > Log?