Is there a way to automate click ok in a script?

is there a way to automate click ok in a script?

…Instead of repeating it over and over by hand?

Only via UI scripting. But what kind of alert or window do you need to confirm actually?

I am getting rid of many similar content files and each time…

The script in the menu Scripts > Data? Like all other scripts it’s actually customizable via the Script Editor.app, see ~/Library/Application Scripts/com.devon-technologies.think/Menu/Data/Find similar contents.scpt. But it’s recommended to customize a copy to avoid conflicts with future updates of DEVONthink.

thanks, but I dont think I am able to do that… simple user here!

If you consider yourself a “simple user” and refrain from scripting, UI scripting is not for you.
If you can specify criteria for the files you want to work with, a smart group might be the way to go: have it select all files, open it and select all files with cmd-a. Then work on the selection

After i did “find and remove similar contents…” I got many messages like this; would it be possible to embed in this script itself a “say yes to all” option?

The script works on the current selection. That’s not something you can emulate with a smart group, I think. One solution might be to tag the similar records in a modified script and then use a smart group to collect them.
The changes would be simple, I guess, but I do not have the time for that now. Maybe someone else steps in.

  1. You aren’t creating an automaton that clicks buttons for you. You are defining actions that take place.
  2. Such a broad response can be a dangerous thing. Would you really want it to delete whatever it finds?

I understand the risk, but sometimes…

I understand the “sometimes” but there will always be that “one time”.

If you are certain it’s “all the time”, then it’s possible to wire things up. If it’s “sometimes”, I agree with @chrillek that marking items and curating after the fact is a smarter and safer approach.

Can you clarify what you’re specifically doing and how often?

I am trying to give an order to different notes I took with different apps (Instapaper, Pocket, etc…) in DEVONthink

amelchi, just wanted to echo what @bluefrog and @chrillek are saying - because I’ve been there in the (distant) past.

Batch deleting copies - hundreds, thousands? - is extremely risky. At some point you realize something shouldn’t have been deleted. And then you may not even know the extent of the problem - how many other documents shouldn’t have been deleted.

The first and last time it happened to me I was forced to go rescue a backup of a database, that was years ago, and then I deleted manually, one by one, what I didn’t want.

Nowadays, I even deliberately KEEP copies of some documents. Not too many, but some. Why? Because they might have been very old jpegs of say, a captured stuff Amazon or eBay list of acquired items with thumbnails, and I wanted to later create 2 or more documents out of each of these jpegs.

So I tag these “Intentional Copy”.

2 Likes

thanks to all, I’ll be cautious…:smiling_face_with_sunglasses:

my main problem is that quite often in the different notes I took with different apps (Instapaper, Pocket, etc…) the content is the same but the titles are different, therefore AFAIK the quite useful Find similar contents.scpt stops to give results…

Does the past tense mean you have moved away from using multiple applications for this note-taking?

Yes,

I try to use only Drafts for quick note taking and more and more DT