Hi, I tried to adapt the “Move” script that can be added to DTPO through the extras palette so that instead of displaying the group/tag selector, the script would move the selected items to the root of the database of the selected items. Unfortunately, this is throwing the error:
I tried this in a few of my open databases, and “X” just adjusts for the respective database id #.
Here is the script as written; any input would be greatly appreciated!
(*
Move the selected record(s) to the root of the database.
Adapted from version 20140112.1 of script `Move__Cmd-Ctrl-M`.
*)
try
tell application id "DNtp"
set theDatabase to current database
set theSelection to selection
if theSelection is {} then error "Please select something to move to the root of " & theDatabase & "."
set fromPath to (the location of item 1 of theSelection) & (the name of item 1 of theSelection)
set theDestination to the root of theDatabase
repeat with thisItem in theSelection
move record thisItem to theDestination
end repeat
-- Post the result to the Log
set movedFrom to "Moved from: " & fromPath & " in " & theDatabase
set movedTo to " -- Moved to: " & theDestination & " in " & theDatabase
set theLogEvent to log message (movedFrom & movedTo) info "Move-to-Root Script"
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