Opening multiple files using AppleScript to DevonThink Perso

Hi,

I am a user of DT Personal, and I thought I could use Applescript to configure a folder action for importing files to DT. I found that opening file with DT will result in importing it.

The idea is simple, I put an empty folder on desktop, name it as “Transfer2DT”, and put folder action script (attached below). But when I run it, the files imported looked small (yes, small), and pdfs are more like thumbnails.

Can someone help pointing out the problem cause and offer solution ?
Thanks a lot in advance.


on adding folder items to this_folder after receiving added_items
	tell application "Finder"
		set fold_name to the name of this_folder
		try
			display dialog "Transfer to DEVONThink, this folder will be emptied"
			repeat with i from 1 to number of items in added_items
				set new_item to item i of added_items
				set the item_path to the quoted form of the POSIX path of new_item
				tell application "DEVONthink"
					try
						activate
						open new_item
					end try
				end tell
				delete new_item
			end repeat
		end try
	end tell
end adding folder items to

Unfortunately I haven’t tested the AppleScript support of the Personal edition of DT.

The Pro edition comes with some handy Finder folder actions scripts which really do their work well - they let you simply drag some items to your ‘DEVONthink Inbox’ folder, they all get imported immediately.

I even customized the scripts to move the imported items to Finder Trash.

DEVONthink Personal has little or no AppleScript support, as indicated on the DEVONthink/DEVONnote Feature Comparison page.

I have tried this script with DT pro (office) and it seems to work fine. I don’t see why it would do what you say with personal, unless DT personal itself is deliberately crippled to only import small previews of the pdfs if they are opened via applescript. This sounds uncharacteristically small-minded from the DTPO team, so I would try to work out if there is perhaps some other problem.

Are you sure that the pdf really becomes small?

But that script does most things in the finder and almost nothing in devonthink itself. it just tells devonthink to activate and then


open new_item

and back to the finder to delete the file.

But of course it could well be that the personal edition is designed to not do the obvious thing if an item is opened via applescript simply to prevent any automation and force use of the more expensive versions.

Maybe someone from DTech has a response that’ll end the speculation. :slight_smile:

Or someone could download DT personal and try this.

Personally, I’d have completely removed any applescriptability from the edition meant not to be scriptable so as to avoid confusion. But that may well be more work than it’s worth.

There are four members of the DEVONthink family. In order of decreasing features they are: DEVONthink Pro Office, DEVONthink Pro, DEVONthink Personal and DEVONnote.

See http://www.devon-technologies.com/products/devonthink/comparison.html for comparisons of the features of these applications.

Under the heading ‘Advanced features’ on that page, note that neither DEVONnote nor DEVONthink Personal has AppleScript support. DEVONnote and DEVONthink Personal are not intended for users who wish to automate procedures. There are a great many users whose needs are met by one of these applications. Books have been written using DEVONnote for management of notes and references.

DEVONthink Pro Office and DEVONthink Pro have a large AppleScript dictionary supporting user development of scripted procedures and include a number of supplied scripts. These applications also support Automator actions.

Obviously, DEVONtechnologies devotes greater development resources and support resources to DEVONthink Pro Office and DEVONthink Pro. For example, Christian has very often provided critiques and suggestions to users to improve their scripts, especially in the Scripts section of the forum.

To put it another way, DEVONthink Pro Office and DEVONthink Pro cost more to develop and support, and so have higher registration costs than do DEVONnote and DEVONthink Personal. These higher end applications better meet the needs of many users.

Bottom line, pick the application in the DEVONthink family that meets your needs. DEVONtechnologies lets you ‘trade in’ your full purchase price investment in one of the family of applications to upgrade to a more powerful member of the family, if your needs require that.

As for me, I virtually live in DT Pro Office and consider it the most useful software on my computer. :slight_smile:

The pdf and image files became small. Kind of between thumbnail and full size,

I understand the full capability of DTPro, but at the moment (esp with student budget), I don’t need yet its full capability. What I wanted is a slight freedom, which if not supported, indicates DT’s policies, which is OK with me…
(imagine riding Porsche to the nearest supermarket…)

at the moment I used this method:

  • Import a folder from Desktop (“ImportDTFolder”)
  • Synchronize it after importing several files into it.
  • Classify the imported files.
  • Delete them from the folder.

But, to be concrete, if I nevertheless use devonthink personal’s applescript dictionary to tell it to open a pdf, will it open it as a preview or simply import it?

That’s not the case. DEVONthink Personal just does not support AppleScript, trying to work around this might or might not work.

The only problem is probably that you’re deleting the files too early, you might try a delay.

thanks for the reply. actually I don’t use the personal edition, otherwise I could have just checked what happens if you tell DT personal to open a file! I was trying to help the person who asked the question.

The script works fine for DTPO, so I guess something more complicated is going on.