Search file name in google

Is there a way to search filename of selected file in google or google image?

you select a file (which is on your hdd) and then search it on google?
maybe it is easier to find it on your hdd? :wink:

This ought to do it...

<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none">
	<label>Search in Google</label>
	<icon1>C:\Temp\Google.jpg,0</icon1>
	<function type="normal">
		<instruction>http://www.google.com/#q={o!} </instruction>
	</function>
</button>
1 Like

rkoegler is right... furthermore, you can use the same method with other sites as long as you have the URL "search" string provided by the site. Here's another example from one of my toolbars:

<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none" type="menu">
	<label>Search Menu</label>
	<icon1>#findpane</icon1>
	<button backcol="none" display="both" textcol="none" type="three_button">
		<label>Search Google</label>
		<icon1>#findpane</icon1>
		<button backcol="none" display="both" textcol="none">
			<label>Search Google</label>
			<icon1>#findpane</icon1>
			<function type="normal">
				<instruction>&quot;/programfiles\opera\opera.exe&quot; &quot;http://www.google.com/search?q={RS|Enter GOOGLE searchstring...|{clip}}&quot;</instruction>
			</function>
		</button>
		<button backcol="none" display="both" textcol="none">
			<label>Search Google for Selected File</label>
			<icon1>#findpane</icon1>
			<function type="normal">
				<instruction>&quot;/programfiles\opera\opera.exe&quot; &quot;http://www.google.com/search?q={RS|Enter GOOGLE searchstring...|{o}}&quot;</instruction>
			</function>
		</button>
	</button>
	<button backcol="none" display="both" separate="yes" textcol="none" type="three_button">
		<label>Search Wikipedia</label>
		<icon1>#findpane</icon1>
		<button backcol="none" display="both" textcol="none">
			<label>Search Wikipedia</label>
			<icon1>#findpane</icon1>
			<function type="normal">
				<instruction>&quot;/programfiles\opera\opera.exe&quot; &quot;http://en.wikipedia.org/wiki/Special:Search?search={RS|Enter WIKIPEDIA searchstring...|{clip}}&quot;</instruction>
			</function>
		</button>
		<button backcol="none" display="both" textcol="none">
			<label>Search Wikipedia for Selected File</label>
			<icon1>#findpane</icon1>
			<function type="normal">
				<instruction>&quot;/programfiles\opera\opera.exe&quot; &quot;http://en.wikipedia.org/wiki/Special:Search?search={RS|Enter WIKIPEDIA searchstring...|{o}}&quot;</instruction>
			</function>
		</button>
	</button>
	<button backcol="none" display="both" textcol="none" type="three_button">
		<label>Search MS Hotfix</label>
		<icon1>#findpane</icon1>
		<button backcol="none" display="both" textcol="none">
			<label>Search MS Knowledgebase for Hotfix</label>
			<icon1>#findpane</icon1>
			<function type="normal">
				<instruction>&quot;/programfiles\opera\opera.exe&quot; &quot;http://support.microsoft.com/kb/{RS|Enter MS Hotfix KB number (Note: leave off the leading &quot;kb&quot;)...|{clip}}&quot;</instruction>
			</function>
		</button>
		<button backcol="none" display="both" textcol="none">
			<label>Search MS Knowledgebase for Selected File</label>
			<icon1>#findpane</icon1>
			<function type="normal">
				<instruction>&quot;/programfiles\opera\opera.exe&quot; &quot;http://support.microsoft.com/kb/{RS|Enter MS Hotfix KB searchstring (Note: leave off the leading &quot;kb&quot;)...|{o}}&quot;</instruction>
			</function>
		</button>
	</button>
</button>

This example is a MENU with three buttons... one for Goolge, Wikipedia, and Microsoft's KB pages.

Each button is a "three-button" button... Clicking LMB puts the contents of the clipboard into a dialog prompt for you to either modify or just hit enter on, and thats the string that will be searched. Clicking RMB puts the currently selected filename in the same prompt which again - you can either modify or just hit enter on.

Edit Note: I use Opera, but not as the default browser... so all my examples call opera to load the URL generated by each button...

1 Like

Excellent, many thanks guys...

Just an additional little tidbit:

Search selected Filename via Google in Directory Opus Resource Center:

"http://www.google.com/search?as_q={file|noext}&as_sitesearch=resource.dopus.com"

I use this command to find picture of selected files.

"http://images.google.com/search?tbm=isch&hl=FR&q={file$|noext}&tbs=isz:l"

But if there is "&" character in filename like "Tom & Jerry", Google only search for "Tom".

How I can replace "&" by "+%26+" in command ?

I don't know if it's the best way to do that but I create this script...

Problem, bad link is send to browser. "+%26+" is replace by current folder :neutral_face:

What's happen ?

Rename PATTERN * to *

@script vbscript
Option Explicit
Dim DOpusRTPath, Shell
DOpusRTPath = "C:\Program Files\Directory Opus\dopusrt.exe"
Set Shell = CreateObject("WScript.Shell")

Function Rename_GetNewName ( strFileName, strFullPath, fIsFolder, strOldName, ByRef strNewName )
Dim NomFichier,strCommand,Ext

	If fIsFolder = False Then 'si c'est un dossier extension = rien
		Ext = Right (strFileName, Len(strFileName) - (InStrRev(strFileName, ".") - 1))
	Else
		Ext=""
	End if

	NomFichier = Left (strFileName, Len(strFileName) - Len(ext))
	NomFichier = Replace (NomFichier, "&", "+%26+")
	NomFichier = Replace (NomFichier, " ", "")
	Dopus.OutputString NomFichier

	strNewName = ""
	
	strCommand = """" & DOpusRTPath & """" & " /cmd " & """" & "http://images.google.com/search?tbm=isch&hl=FR&tbs=isz:l&q=" & NomFichier & """" 
	Dopus.OutputString strCommand
	
	Shell.Run strCommand,0,false  
  
End Function