Last active
May 5, 2021 15:58
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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