requesting 2 scripts

I wish I could figure out how to applescript but it just doesn’t seem to want to compute (I did try, honestly!)

Anyway, with the new DT2 sorter, I really would like to put two folders in to my sorter- one for .doc/.docx and one for pdf’s that need scanning. I would like to attach a script to the first one to automatically convert and .doc or .docx to .rtf and trash the original, and for the PDF’s, for the OCR process to begin automatically and trash the original.

Thanks so much to anyone who might do this :slight_smile:


I have the same issue with applescript…I’m hopeless at programming things. But these two scripts would be valuable if anyone takes the notion. :slight_smile:

I recommend you just learn to AppleScript. It’s really easy once you get the hang of it.

Open up Script Editor and type/paste the following:

tell application "DEVONthink Pro"
end tell

Run it, and DEVONthink Pro is brought to the front.

That’s 90% of AppleScript right there: tell application “Whatever” to do something. To do what? Well, AppleScript-supporting applications all have built-in Dictionaries. Go to File > Open Dictionary… and click on DEVONthink Pro. You now have a concise, error-free (or else the AppleScript commands wouldn’t work) reference to every single thing you can do with DEVONthink. (The built in AppleScript functionality, such as loops and so on, is best gotten from the internet)

Click on “DEVONthink Pro Suite” and you see a list of commands. For instance, the top one: add download, whose description is the following.

add download v : Add a URL to the download manager.
add download text : The URL to add.
[automatic boolean] : Automatic or user (default) download.
[password text] : The password for protected websites.
[referrer text] : The HTTP referrer.
[user text] : The user name for protected websites.
→ boolean

So to add a download, you just have to change your Script Editor code to something like this:

tell application "DEVONthink Pro"
	add download ""
end tell

(Note: DON’T do this.) But you get the point. I learned almost everything I know of AppleScript from reading the example scripts that Christian included with DEVONthink. They have loops, functionality of other applications, pretty much everything you’ll ever have to deal with. You can learn a massive amount from them. And if something doesn’t work, Google the error message and you’ll likely come across a post explaining why something didn’t work and what you should do instead.

AppleScript is seriously one of the most straightforward and best-documented languages in existence. It is weird, but it’s far simpler than, say, Objective-C. And don’t even think about assembly language :stuck_out_tongue:

you lost me at “just learn” :laughing:

Whereas, I think I’ll give it another go. If I come up with something useful and usable, I’ll let you know danzac.