Can people give me an idea how they use the comments section of the info panel? Do you use it like tagging/folksonomy metadata or otherwise? Do the comments help the search and auto/classify system?
Interesting question. Maybe even a topic for the Usage Scenarios subforum?
Iāve rarely used comments, but was recently inspired by a screenshot (on 43folders or some other GTD site) of a List view window with the Comment column enabled and comments used to annotate items.
Iād probably be using comments more if there were a āShow Commented Documentsā search criteria. In other words, Iām often as interested in which items are commented as the actual comment text. Itās another way to filter and find what Iām looking for. And I still miss not being able to search for labeled items, but not enough to keep me from using labels⦠within manageable limits.
Generally, Iāve been reluctant to fully use certain features in DT (e.g. comments) unless their supporting tools (e.g. searches) are sufficient to sustain my coherently usable databases. And product evolution has been in my favor for adding capabilities I do find ways to use effectively (often immediately) so Iām not focusing on whatās lacking, although I certainly have no shortage of opinions and suggestions.
I find comments useful for attaching descriptions to images in my DT database. I usually attach brief descriptions describing the origin and other useful information about the image. This is the logical place I find to put this information. Also when viewing the group containing the images in Icon view the comments are displayed when mousing over the images which I find is useful.
psmyth, I donāt seem to have the comments displaying when I mouse over my images in Icon view. Iām test-driving DEVONthink Personal Edition 1.9.3 ā what version are you using? Is there a setting I need to modify?
Hmmmm! Just checked and this isnāt working in 1.9.3 for me either. This was definitely working previously. Anyone else seen this? Iāll report it as a bug. When viewing a window full of images this was very handly as you could see the information just by mousing over the items. I havenāt done any work on the particular project which uses those images recently which is why I hadnāt noticed the change.
Iām still figuring out my āwork styleā with DT. I saw an article (probably on 43folders) about maintaining a library of excerpts, quotations, etc. within DT. The author used the document title to house pretty much the entire bibliographical attribution for each snippet, but I found that to be difficult to browse and organize.
Instead, when I clip from a web site or enter passages of interest from books, I put the bibliographical attribution in the DT comment field. This is useful for me because itās there if I really need it, but I donāt see it all the time. For most of the work I do, these clippings are more brainstorm/idea generation fuel rather than something Iām going to use as support in a paper, etc.
This may change in the future, but thatās what Iām currently using the comments area for.
Iāve decided to go whole hog and use the comments field for much of my metadata. So far Iām Including keywords for file type (NEWS, ARTICLE, BOOKnotes, Notes etc) and topics as well as more freeform data. Most usefully, Iāve adapted the smart group script to search only the Comments field. So if I want to gather all ARTICLES about COGNITION and ARTS but leave out the chaff in my notes and snippets, I can.
Iāve also adapted a script to ask for a Keyword and add the tag to the comment fields of multiple documents in one shot. Ideally I need to figure out how to grab selected text and bypass the ask dialogue alltogether - this would result in a kind of āSet as Commentā command to match āSet As Titleā. But my scripting skills are very rusty and I havenāt figured it out yet.
Dumb question, I know, but can some scripter out there explain how to grab selected text into a variable and pass it on?
Oh and one more thing: Christian, since some of us are indeed using comments in novel ways; would it be possible to allow SORTING on the Comments field? That would be very useful for us anal keyword types.
Comment away
Eiron
Iād be interested in that script, mind sharing it?
Well itās a bit of a sloppy adaptation of Christianās āAdd Suffixā Script; and I hope he doesnāt mind me posting it here, but it works and here goes:
Iām going to cut and paste āas isā so hopefully you can just cut and paste it back yourself. It might look a bit messy here but should paste OK into a new Applescript editor file. I suspect thereās a better way to do this but this will have to do for now.
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
I suppose I should have changed the variable names; but Iād rather keep as much of Christianās clean code as possible. I suggest you add spaces before or after comments in the dialog box.
Good Luck
Eiron
Thanks Eiron, it worked! To use this fully I quickly realized another script would be needed to delete all info in the Comments field too, so I modified it further to do this. This is the first script I have ever āmadeā or modified (I really donāt know anything about it, just sort of poked around with it) but it seems to work fine, so here it is (use at your own risk):
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
Tiger uses the āSpotlight Commentsā field to store custom metadata about any file. This field is indexed by Spotlight, so of course it can be searched, used as the basis for a smart folder, etc. This can be very useful, if the discipline is established to create the comments when a file is either created or downloaded. To that end, there are a number of Automator scripts in the wild that, for example, allow the user to batch update a selection of documents in Finder.
This feature is very relevant to DT. When a file with Spotlight Comments is imported into DT (Pro, anyway), the Spotlight Comments are preserved in DTās āCommentā field. As noted in the discussion above, these comments can be searched by DT, and with eironās adaptation* of Christianās Smart Folders script, can be used as the basis for a DT smart folder. Also, with eironās and mosesā scripts above, the user can batch update a selection of documents in DT. A nice symmetry of function is thus maintained between the Spotlight-enabled Finder/file system and DT, using the same metadata for a given file.
Now, hereās a challenge. For those of us who save the same document in both Finder and in DT, it would be very useful to expand Christianās āImport to DT (Pro)ā folder action script. The expansion would prompt the user to add metadata to any file(s) added to the target folder, before that file is imported to DT. This would allow the following workflow:
1. Download, or create-and-save, a file to the target folder in Tiger's file system. ("Documents" folder might work well here :wink: )
2. The folder action springs into action, prompting the user to add tags into the file's "Spotlight Comments" field
3. The user adds comments, clicks on "Save" button
4. The file is then both saved in the Finder folder and imported into DT, with tags intact in both instances.
Does something like this exist today? If notā¦I donāt know if Automator is up to the task, or if thatās something best accomplished in AppleScript.
Any takers?
- eiron: could you post this script as well?
Eiron,
Iāve liberated (i.e., stolen) your script and used it. It works perfectly! Thank you very much. Applescripting is one of those things Iāve meant to learn the past few years but have never managed to find the time to do (there are several other useful but unlearned skills Iāve got in this same āto doā category). Seeing what youāve done and noting the 75,000,000 scripts (or so it seems) that theyāve put into Pro, maybe Iāll start to learn it little by little. Certainly plenty of go-bys.
Again, thanks.
ChemBob
Very cool scripts!
Eiron, any way you could share this one too? This would be most valuable. Itās been years since Iāve tried my hand at applescripting.
Alexandria
Here you go Alex
-- Smart Group (All Words)
-- Created by Christian Grunenberg on Oct Fri 22 2004.
-- Copyright (c) 2004-2005. All rights reserved.on run
try
tell application "DEVONthink Pro"
repeat
display dialog "Enter the words to use:" default answer "" buttons {"Cancel", "OK"} default button 2
set theWords to the text returned of the result
if theWords is not "" then exit repeat
end repeat
set theRecord to create record with {name:theWords, type:group, attached script:"~/Library/Application Support/DEVONthink Pro/Smart Group/All Words In Comments.scpt"}
my triggered(theRecord)
end tell
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 run
on triggered(theRecord)
try
tell application "DEVONthink Pro"
if type of theRecord is group then
set theString to (name of theRecord) as string
search theString comparison no case within comments operator all words replicate to theRecord with removing replicants
end if
end tell
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 triggered
the changed line is
search theString comparison no case within comments operator all words
where the search is within ācommentsā instead of within āallā. With some very minor tweaking of the script you can specify case, all words/any words etc. If I can do it, you can. To see the syntax, just take a glance at the Devonthink dictionary by choosing āDevonthinkProā under Open Dictionary in Script editor.
Hope this does what you want.
Eiron
That did the trick! Many thanks, Eiron. And thanks too for the explanation. I will take a look at the syntax and play around with the script, and some other scripts as well. It would be well worth spending some time to learn how to do some basic scripting with Applescript.
But until then, this works great!
Alexandria
So I see that these smart folders are kind of pseudo-smart folders. It would make sense, now that I think of it, since itās an applescript. But when I add a new file with an existing keyword in the comments field, I have to run the script over again and create a whole new folder. The new file is not automatically added to the āsmart folder.ā This is rather cumbersome. Unless Iām missing something here.
I would like to reiterate the request, made often here, for true keyword functionalityāwith smart folders that are truly āsmartā and the ability to sort according to keywords, etc.
Alexandria
I agree with this. I donāt think they should be called āSmart Foldersā but something else (perhaps āScripted Foldersā?)⦠it is confusing, given that they do not operate exactly like Smart Folders do throughout the rest of the system and the Apple apps. They are also not āset-upā like Smart Folders are in these other apps, but through the script menu. For Mac users who download and try DT expecting the advertised Smart Folders ability this will be confusing and disappointing. As the ability to have scripts attached to folders is very powerful in itās own right I suggest keeping them, but calling them something else, and then introducing real Smart Folders that operate and are set-up like in the other more familiar apps.
Let me add one other problem I have found with calling them Smart Folders: they contain replicants. Real smart folders donāt even contain replicants, just references. Hereās the problem as I see it: letās say I create a smart folder to contain all files with the words āolive oilā in it. Now, it contains replicants to my other DT docs. Letās say File #1 contains the words āolive oilā and is in a Group called āOlive Oil Statisticsā. At some point I decide that File #1 is useless for that folder and I will never need it again. I delete it from the Group Olive Oil Statistics hoping to have trashed it from my whole DT file system ā but no, it is retained in my āsmart folderā. OK, now I know clever DT users will chime in here and say to use the Delete All Instances feature, and that would work⦠but, letās say I may not want to use that feature because I fear I may have the file rightfully filed somewhere else where I may want to keep it⦠you see the confusion? Sure, I can also go to my smart folder and see that a file is no longer red and know it is only in it now and get rid of it, but all this adds further complication. So, again, these are not really āsmart foldersā in the truest sense of the way Apple uses the term. Now the funcitonality I mention here, which is not akin to the way I would expect a smart folder to act could be extremely useful for other tasks and circumstances, but I believe it is misleading to be thinking of them as Smart Folders.
Alex, have you actually attached the script to the folder (using its get info window) ? This runs the script automatically every time the folder is opened. There is no need to ācreate a whole new folderā each time. I fail to see how this is inferior to TigerFinderās new (REALLY pseudo) āSmart Foldersā which after all are merely saved searches that run (rather slowly if you have a multiple external drive pbook like mine) each time they are āopenedā.
The main drawback to DTproās approach is that the displayed number of enclosed items is not updated until you select/open the folder ā hardly tragic.
As for being able to sort on the comments field Iāve repeated this request in here recently but no reply so far.
eiron:
Comment field sorting would be useful, although confusing/ambiguous/not helpful if thereās more than one text string. Having multiple sortable āmetadataā fields available that can be accessible to scripts would really open logical possibilities to warp speed.
This will be on my list to note to Christian.
And you are correct about the āsmart groupā script, as it refreshes replicants of matching content every time the group is āopenedā.
No, didnāt know you could/should do this. I created the folder with the script and assumed it was then āattached.ā I manually set it to the script in the info panel and it now works as you suggestedāit updates when I open it.
Iām used to āsmart foldersā meaning that when a file is created and keywords set, or whatever parameter determines whether it belongs in a smart folder or not, the file is automatically included. That is different than what DT does, though this is a real improvement over what it had before (nothing), and with the script attached, it does work more effectively, so thanks.
Alexandria