On Feb 14, 2015, at 17:41, Chris Nidel < email@hidden> wrote: Thanks a bunch.
______________________________________________________________________
Hey Chris,
You're welcome. however, when I try to make it set the contents of the tag, it does not work.
This corrected handler works.
---------------------------------------------------------------------- on transfer_data(sub_file_name, sub_full_tag) tell application "DEVONthink Pro" set recoList to lookup records with file sub_file_name set recoListLength to length of recoList if recoListLength = 1 then set theRecord to item 1 of recoList tell theRecord set tags of theRecord to {sub_full_tag} end tell else if recoListLength = 0 then error "Zero records were found!" else if recoListLength > 1 then error "More than 1 record was found!" end if end if
end tell end transfer_data
transfer_data("Ben.Test.OCR.pdf", "NUTS!") ----------------------------------------------------------------------
When creating a list please use curly-braces instead of braces - braces compile to curly-braces anyway.
set tags of theRecord to {sub_full_tag}
You were trying the set the tag, and there is no such property.
set the tag of theRecord to [sub_full_tag] # (Your Code)
See how tag is the same color as theRecord and sub_full_tag? That tells you tag is just a variable name and not a proper property of a record.
The actual tags property is a list, as you can get/set more than one tag at once.
Note that setting tags will destroy any already existing ones.
If you want to preserve any extant tags you have to extract them and add them to your new tag list.
-- Best Regards, Chris
|