Saturday, October 6, 2012

Copy full path of file in DevonThink Pro Office to clipboard

Relatively often I want easy access to the full path of a file previously imported to DTPO.  This often happens when I need to upload a file to a website.  The "Reveal in Finder" toolbar button is useful, but doesn't give you access to the text of the full path.  I used Automator to create a little application that I saved in the DTPO "Scripts->Toolbar" folder.

Step One:  Download the "Get File Path" Automator action from this page.  Install the action within Automator using the "File->Import Actions..." menu option.

Automator window showing the entire script, and the "import Actions..." button.

Step Two:  Create a new Automator Applications project.  Using the search field at left, search for all actions with "Records" in the title.  Drag the "Get Selected Records" to your new project.  Follow this with "Get Item from Record".  Next add the "Get File Path" that you just downloaded.  I recommend setting the options to extract an escaped POSIX (unix style) path name.  To complete the script, simply drag the "Copy To Clipboard" action to the end of the "code".

Step Three:  Choose save, and save your new tool to:
~/Library/Application Support/DEVONthink\ Pro\ 2/Scripts/Toolbar
Once the workflow has been saved like this, you need to restart DTPO.  Then look in the scripts menu available in DTPO, and,  if you have selected a file or folder in DTPO, your new script should be visible under the "Tool-bar.  It should also be available to add to the toolbar itself when you customize the toolbar.

DTPO window with the "Get Path" script on the toolbar (it's the little clipboard that says "Path" under it!).
The output of the script is the full pathname extracted to the Clipboard, entirely ready to be useful!  I gave my version a cute little logo, but this is not required!

Let me know questions or comments below!

No comments:

Post a Comment