I downloaded a copy of the latest DT Pro Beta, and I was wondering where Categories are. The feature gets mentioned on the DT version comparison chart, but I can’t find it in the program. Has it not been implemented yet? Or Im’ I just missing it? Thanks.
#1 : categories still seem not to be available in DTpro 1.0 or am I mistaken ?
#2 : is it possible to assign the same comment to multiple items in 1 move ?
#3 : is it possible to do that when there are already pre-existing comments without deleting them ?
NB : I intend assigning multiple keywords, ie, categories to each item through the comments column and I cannot do it otherwise if there is no specific category column… cf.supra
These scripts have already been swapped on the forum here, and will be useful for what you have requested:
Add to Comments Field (this will add text to all the Comments field in all selected docs, it will not delete what is there):
using terms from application "DEVONthink Pro"
tell application "DEVONthink Pro"
activate
try
set this_selection to the selection
if this_selection is {} then error "Please select some contents."
repeat
display dialog "Enter the comment to use:" default answer "" buttons {"Cancel", "OK"} default button 2
set suffix to the text returned of the result
if suffix is not "" then exit repeat
end repeat
repeat with this_item in this_selection
set current_comment to the comment of this_item
set new_item_comment to current_comment & suffix
set the comment of this_item to new_item_comment
end repeat
on error error_message number error_number
if the error_number is not -128 then
display dialog error_message buttons {"OK"} default button 1
end if
end try
end tell
end using terms from
Delete Comments Field (if you need to start afresh, this will delete all text in the Comments field of all selected docs):
using terms from application "DEVONthink Pro"
tell application "DEVONthink Pro"
activate
try
set this_selection to the selection
if this_selection is {} then error "Please select some contents."
display dialog "You are about to delete all contents in the Comments field, this cannot be undone. Are you sure?" buttons {"Cancel", "OK"} default button 2
repeat with this_item in this_selection
set the comment of this_item to ""
end repeat
on error error_message number error_number
if the error_number is not -128 then
display dialog error_message buttons {"OK"} default button 1
end if
end try
end tell
end using terms from
Glad they could help. Yes, the keywords are “glued” together, which could be useful if you want them to be for some reason, or if you want the ability for them to be separated by something other than a default character. In the original script, to separate them you just have to add, in front of the new word, a space, or a comma and space, or whatever separator you want.
I can’t tell you if your tweaked script is correct or not, as I don’t know AppleScript either. The first script was posted by someone else on the forum awhile back, and then the second one I created by modifying the first one, just like you – “blindfolded”. I figure, if it works, then it’s probably fine. Another scripter can respond to your question more accurately though…