Is there a way to do this?

I highlighted hundreds of files in a research folder. Not the entire article, just salient sentences or paragraphs within each article.

Now I need a print-out of those highlights.

Do I have to open. each. article. and. search. for. the. highlight. then. copy. and. paste, into. a. new. doc, or is there some faster way to do this?

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. :frowning:

Right — but don’t go TOO heavy on the beer. :slight_smile:

wdfs did say a beer. :slight_smile:

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). :slight_smile:

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

Christian

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.

It does if it’s executed via the internal Scripts menu. Executing it via Apple’s Script Editor uses Preferences > Import > Destination.

That’s how I’m executing it. The note goes to the global inbox.

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. :stuck_out_tongue:

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?

On a re-read it does seem more like how you’re parsing it. :slight_smile:

Hopefully of quality and not only quality. :slight_smile:

Actually, Bill, after a while, didn’t really notice, especially when I was preoccupied initially with the fiction of ‘work’. :stuck_out_tongue:

That’s not that easy right now but I’m working on a more sophisticated solution for the upcoming beta.

I’ll wait. Thank you anyway. You saved me hours of work and from getting cross-eyed. Thank you.

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.

I haven’t tried but seems like you could convert pdf’s to rtf’s and use the script.