P.S. I am checking into Eric’s new Annotation template, which is great. But it doesn’t solve the problem of capturing highlights from this MANY GB database.
This is probably be a beer-and-Grade B movie-and whole night affair to solve.
But the phrasing is ambiguous. It can be parsed as “a beer night” AND “a grade B movie night”. “Beer night” can have a range of meaning, especially on a college campus, and especially at a frat house. I’ve been told that some frat houses show movies on beer nights (although not necessarily grade B movies).
Of course, we must assume that wdfs is actually working hard on his database all night.
If the articles are RTF/RTFD files, then you could use a simple script like this one:
tell application id "com.devon-technologies.thinkpro2"
set theSelection to the selection
set theHighlights to ""
set theWindow to missing value
repeat with theRecord in theSelection
if type of theRecord is rtf or type of theRecord is rtfd then
if theWindow is not missing value then
set record of theWindow to theRecord
else
set theWindow to open window for record theRecord
end if
tell text of theWindow
set skipped to false
set insertName to true
repeat with theAttribute in attribute runs
set theProperties to properties of theAttribute
set theBackground to background of theProperties
try
if theBackground is not missing value and theBackground is not {65535, 65535, 65535} and length of (theAttribute as string) > 1 then
if (insertName) then
set theHighlights to theHighlights & (name of theRecord) & return
set insertName to false
end if
set theHighlights to theHighlights & (theAttribute as string)
if skipped then
set theHighlights to theHighlights & return
set skipped to false
end if
else
set skipped to true
end if
end try
end repeat
if not insertName then set theHighlights to theHighlights & return & "---" & return & return
end tell
end if
end repeat
if theWindow is not missing value then close theWindow
create record with {name:"Highlights", type:text, content:theHighlights}
end tell
This is very useful. Couple of things: could the script put the new document with the collected highlights in the database where the highlighted document is, instead of the global inbox? Could that new document have a name like “Highlights: [insert name of target document]” and a link back to the target? When I run the script it flips the focus to some other open window on the desktop. This would be a nice addition to the smart templates, similar to the “annotations” template.
Yes, you’re right. Just use a different setting for Preferences > Import > Destination or add “in current group” after the “create record with {…}” command.
Well…it was many beers…and the database went untouched…and I told myself I could solve it by slaving over 5x8 cards at the local pub by, you know, intuiting the answer or something…blah-blah-blah. Stumbling home at 4 AM was the result.
Now…after three cups of java laced with instant coffee, I can read Christian’s generous solution and will attempt to pull it off myself. Will let you know. BTW, Christian and Eric, these solutions you guys come up with on the fly to help individual situations are really appreciated, as is Bill’s 24/7 all-hands-on-deck ForumWatch. Now we just need a three or four day conference in some cheap country, or on some cheap ship, so that we can all learn to use this program the way you guys know it. God knows I’d save up for that.
VERY NICE, CHRISTIAN! THANK YOU! Gee, I drink, you work. Not bad.
I like that the name of the record precedes the clip (highlight). I dont know Apple Script, but I will muck about if given directions: how can I make the record title bold, and what line in the script would precede it?
Hello Everyone!
I am stumbling on this thread and I had a similar question: I was wondering if it was possible to make a smart group with all my highlights, even in pdf files (mainly web captures)?
If not, I’ll try the script, but is there a way to make it work also with pdfs?
Any suggestion will be highly appreciated!
Thanks for the good work!
Best
Mathias
Post scriptum to my previous query: if there is no workaround, I can capture web page in rtf only and this works quite well. Still, I’d be curious to know if we can do that with pdf’s highlights.