I’m on a mission here, I’m either making something enormously useful or something which will have everyone telling me I’m using tags wrong
I’m trying to access the plain text and metadata of the currently selected record into an array, which I can merge with plain old Javascript Array.join(). Here’s my code:
var record = Application('DevonThink Pro').contentRecord;
var textPool = [ record.plainText,
record.metaData.kMDItemTitle,
record.metaData.kMDItemHeadline,
record.metaData.kMDItemURL,
record.metaData.kMDItemSubject,
record.metaData.kMDItemDescription,
record.metaData.kMDItemComment,
record.metaData.kMDItemKeywords,
record.metaData.kMDItemCreator,
record.metaData.kMDItemCopyright,
record.name,
record.url,
record.comment ];
body = textPool.join(" ");
However, I get the error
Error: Can’t convert types.
from
record.plainText
Where am I going wrong? Am I accessing the currently selected record incorrectly? I got the impression that it was an object whose properties I could access.
My next question will be about setting tags on the object, based on the plain text string of the tags, if anyone’s interested.
and I find the Haskell Prelude a very useful set of composable, well-reasoned and well-tested abstractions ( my snippets macro draws on c.200 Prelude-derived functions for JavaScript, and close to that number for AppleScript too)