Responding to Lisa's question in
this thread.
To export selected notes directly to DEVONthink (without having to set up an export template, save to a file, then import into DEVONthink, etc., etc.) you can do this.
Put this in a Tinderbox code note named
Send2DevonAS:
Code:-- In DEVONthink the new records will appear in your default group for new notes; change incoming group to current group or other value if you want to change that behavior.
-- Make sure there are no straight apostrophes in this script or in the Tinderbox attribute values. A good solution is using Mark Anderson "quotify" to convert to curlies. See http://www.eastgate.com/Tinderbox/forum//YaBB.pl?num=1265006946/0#4
on run argv
--put values of TB attributes from command line into AppleScript variables:
set {recordName, recordContent, recordURL} to {item 1, item 2, item 3} of argv
--now just your usual brilliant AppleScript code-- can add date, etc:
tell application id "DNtp" to create record with {name:recordName, content:recordContent, URL:recordURL, type:text} in incoming group of database 1
end run
And this action code in a new stamp I've named
Send to Devon:
Code:runCommand("osascript -e '" +$Text("Send2DevonAS") +"' '" +$Name +"' '"+ $Text +"' '"+ $URL+"'")
Then select the notes in Tinderbox that you want to export to DEVONthink and apply the stamp. That's it. They'll all be sent over in a flash (minus, of course, any text formatting, which I think you lose exporting the hard way as well).
The only tricky part, I found, was getting the quoting right in the stamp action code. You need it to concatenate to: osascript -e followed by a space followed by the script surrounded by single quotes followed by a space followed by the first attribute surrounded by singlestraightquotes followed by a space followed by the second attribute surrounded by singlestraightquotes, etc. Because of the command line quoting you need to avoid any single straight quotes in the script itself and remove any that lurk in attribute values using something like Mark A's
"quotify" to convert to curlies. Perhaps some day Tinderbox will have a friendly wrapper that shields the user from these inconveniences, something like:
runAScript($Name("MyASCodeNote"),$MyTbAttrib1,$MyTbAttrib2, $MyTbAttrib3, …) and,
runAScript("/path/to/script.scpt",$MyTbAttrib1,$MyTbAttrib2, $MyTbAttrib3, …)Anyway, in the AppleScript the Tinderbox attribute values included by the stamp's action code on the command line are accessed as
item 1,
item 2,
item 3 etc. of the mandatory "run handler", here named argv.