How to alter a droplet?

Hi there,

I found a nice way to get pdfs attached to an e-mail directly into my DTPO database: the droplet “Import action”. I just drop the pdf onto the icon in the Dock, but …

it does not import it into my created Inbox, but in the “homebox” or how ever this is named.

How can I change the destination so, that the pdf will go directly into my inbox?

Greetings

Marcus

Just replace…


tell application "DEVONthink Pro" to import this_path without unstyled

…with…


set theInbox to create location "/Inbox" -- Location of your inbox
tell application "DEVONthink Pro" to import this_path without unstyled to theInbox

Or use this droplet using the destination specified in the Preferences > Import pane:


on open these_items
	repeat with this_item in these_items
		try
			set this_path to POSIX path of this_item
			tell application "DEVONthink Pro"
				if exists incoming group then
					import this_path to incoming group
				else
					import this_path
				end if
			end tell
		end try
	end repeat
end open

Cool, works perfect.

You make my day.

Greetings.

Marcus

When I try the code:


set current group to "/Inbox"

I receive a NSInternalScript Error

When I try the code:

on open these_items 
   repeat with this_item in these_items 
      try 
         set this_path to POSIX path of this_item 
         tell application "DEVONthink Pro" 
            if exists incoming group then 
               import this_path to incoming group 
            else 
               import this_path 
            end if 
         end tell 
      end try 
   end repeat 
end open 

it will not compile, expecting a “then” where the “group” in “incoming group” in the first if statement.

Is there something wrong with my Applescript that prevents me from being able to use all of DEVONthinks commands?

“current group” is a read-only value.

I’ve just compiled this snippet but no problems. Do you use DT Pro 1.3.1?

I get the same “expecting then” errors

I changed the prefernces to point ot he group i want, then copy and pasted the script exactly.

mac 10.4.10, DEVONthink pro 1.3.1

Which browser did you use to copy the code? I’d suggest to use a WebKit browser like Safari or DEVONagent.

(I did use Safari)

Ok, here’s the problem:

If you paste in script editor and press compile, you get all kinds of errors.

If you just save as (app bundle for me with Intel), then drop an item on the app, it will toss it into the designated folder without comment.

Go figure!

Just did this and again no problems. Maybe you should clear the various library caches and restart your machine.

I’m having the exact same dillema with what i understand to be a “droplet”; however, i’m a bit more ignorant: where is the code one needs to change to have an effect on the dropping action. Is it in DevonThink? the browser? the OS itself?

I’m a newbiew to OS X, and to AppleScript, so please excuse the ignorance!

If you’re really referring to droplets and not to drag & drop, then the code is of course in the droplet and can be modified by anyone. Just open the droplet in Apple’s Script Editor.

Okay, I’m clearly not understandign this clearly. I thought a “droplet” was a bit of jargon referring to the drag and drop action to the dock. What, then, is a droplet? And where is it to be found to open with AppleScript?

Thanks,
K.

Droplets are a special kind of scripts accepting dropped files & folders. The downloaded disk image contains several droplets in the folder Extras > Scripts > Droplets.

Okay, thanks. A separate question then–is there a way to modify the “drag and drop” operation to DevonThink in the dock so that it moves incoming documents to a folder of one’s choice (say, “Inbox”) instead of the root level?

That’s not possible but there are two alternatives:

  1. Drag & drop to the Groups panel of DEVONthink
  2. Use a modified droplet (see above)

The Groups panel is probably not as widely known and used as it should be.

Set Preferences > General - Interface so that the option “Hide Groups when not in use” is NOT checked.

Choose Tools > Show Groups.

This panel will float above any application, including the Finder. It will let you drag a file or selected text/image to any group in your database.

I place the Groups panel to the right side of my screen and minimize it to the Dock. To make it available for use, click on it in the Dock. When finished, press Command-M to send it back to the Dock.

Note: the Groups panel must be reactivated using Tools > Show Groups each time a database is launched.