Using "Menu —> Data —> Move to..." deletes contents of new note

I’ve found what I think is a bug—and while it’s not any real inconvenience to me, I thought I’d bring it to your attention:

When I create a new note, paste text into it, then choose Data —> Move to…. from the menu (or Move to “X” again, its content disappears (see attached video).

This occurs regardless of whether the note is Formatted, Rich Text, or Plain Text.

Here’s a link to a screenshot video that shows what I’m describing (the screenshot software superimposes mouse clicks and key presses).

Two caveats:

  1. This only occurs when the note is open in its own window, as seen in the attached video. If I create the new note in the main DT3 window, don’t open it in a new window, then choose Data —> Move to…, it works fine: the note is moved without deleting its contents.

  2. The text contents don’t disappear if I manually save the note by using Data —> Save after pasting in text but before moving it.

The only reason I’ve noticed the bug is that I frequently use a script to create a new note from a Safari page (with URL and the page title), and the new note automatically opens in its own, new window. Then I’ll paste copied text from the page and use Data —> Move to… to file it—but I often forget to save before moving. It’s not a big deal, as the window stays open, I see the text disappear, and then simply re-paste the text.

I love DT3 and am not complaining at all—as I said, it’s really no inconvenience to me—I just thought you might want to know, in case it’s something that could cause other issues. It’s also entirely possible, and maybe probable that I’m doing something wrong or need to change some setting—in which case I’d love to remedy it.

Thanks as always for the expert help!

If you already know where you want to store the new note before you’ve pasted the text from Safari here’s an idea:

In your script

  • use display group selector to ask for a group
  • create directly into this group

That sounds super helpful!

But I’m a total novice with scripting—I think you helped me with the original AppleScript.

Attached is a screenshot of it—for some reason I can’t get the indentation to work in this post.

Would I put display group selector instead of in current group—and after it?

Sorry I’m so clueless!

William

PS: the un-indented text of the script…

-- Create empty formatted note with name and url to paste manually

tell application "Safari"	
	tell current tab of window 1
		set theURL to URL
		set theName to name
	end tell
end tell

tell application id "DNtp"
	try
		set theRecord to create record with {name:theName, URL:theURL, type:formatted note, source:""} in current group
		open window for record theRecord
		activate
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
		return
	end try
end tell

You could replace in current group with in (display group selector) but personally I like to have it on its own line.

-- Create empty formatted note with name and url to paste manually (with group selector)

tell application "Safari"
	tell current tab of window 1
		set theURL to URL
		set theName to name
	end tell
end tell

tell application id "DNtp"
	try
		set theGroup to display group selector "Create note in:"
		set theRecord to create record with {name:theName, URL:theURL, type:formatted note, source:""} in theGroup
		open window for record theRecord
		activate
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
		return
	end try
end tell

PS You can post a script wrapped in three backticks, like this

```
script

```

I would suggest manually saving is a habit everyone should have. This has been true for decades.

But the report is noted. Thank you.

Thanks, Pete—this is perfect!

One of these days, I’m going to learn scripting—right after I clean the gutters…

In seriousness, I so appreciate your help,

William

1 Like

An excellent point!

And I hope it’s helpful.

Thanks for all your hard work here,

William

1 Like

Thank you for the bug report, the next release will fix this.

It is indeed fixed—that’s awesome!

I really appreciate your responsiveness — and everyone’s thoughtful replies!

William

2 Likes