See also on Google and Spotlight (like Notemind)

As promised before by Christian, “Get concordance of” command for scripts is here in DTP 1.3. Thanks! :smiley:
I wrote two scripts for submitting top 5 weighted words of a document to Google or Spotlight (like Notemind does).
These are my very first applescripts so suggestions will be appreciated.
The one for Google:


--See Also on Google script
--Submits 5 top weighted words of the selected document to Google 
--Written by physicistjedi

tell application "DEVONthink Pro"
	activate
	try
		set number_of_words to 5
		set this_selection to the selection
		if (count of this_selection) is not 1 then error "Please select one content."
		set this_document to item 1 of this_selection
		set concordance_list to get concordance of record this_document
		set search_words to ""
		repeat with counter from 1 to number_of_words by 1
			set next_word to item counter of concordance_list
			set search_words to search_words & next_word & "%20"
		end repeat
		set search_address to "http://www.google.com/search?q=" & search_words
	end try
end tell

tell application "Safari"
	try
		activate
		open location search_address
	end try
end tell

The one for Spotlight:


--See Also on Spotlight script
--Submits 5 top weighted words of the selected document to Spotlight 
--Written by physicistjedi

tell application "DEVONthink Pro"
	activate
	try
		set number_of_words to 5
		set this_selection to the selection
		if (count of this_selection) is not 1 then error "Please select one content."
		set this_document to item 1 of this_selection
		set concordance_list to get concordance of record this_document
		set search_words to ""
		repeat with counter from 1 to number_of_words by 1
			set next_word to item counter of concordance_list
			set search_words to search_words & next_word & " "
		end repeat
		
	end try
end tell


tell application "Finder"
	activate
end tell

tell application "System Events"
	tell process "Finder"
		click menu item "New Finder Window" of menu "File" of menu bar 1
		click menu item "Find…" of menu "File" of menu bar 1
		keystroke search_words
	end tell
end tell

I think the way I got spotlight results is not very elegant. Does anybody know a better way?

I still think that we should have these natively.

I hope it will be helpful for others as well,
pj