Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thespacedoctor/cd480d4a9453e98032d0 to your computer and use it in GitHub Desktop.
Save thespacedoctor/cd480d4a9453e98032d0 to your computer and use it in GitHub Desktop.
[Replicate Item in Devonthink to specific location] Replicate a record to another location in devonthink #devonthink #applescript #duplicate #replicate
try
tell application id "DNtp"
set databasePath to "/Users/Dave/Dropbox/devonthink/home media.dtBase2"
set toDatabase to (POSIX path of databasePath)
set toDatabase to open database toDatabase
set theSelection to selection
if theSelection is {} then error "Please select something"
set fromPath to (the location of item 1 of theSelection) & (the name of item 1 of theSelection)
set fromDatabase to toDatabase
set toPath to "some/other/folder/in/database"
set theDestination to create location toPath in toDatabase
repeat with thisItem in theSelection
replicate record thisItem to theDestination
end repeat
end tell
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment