Google Desktop Search plug-in

A place where plug-in developers can share their knowledge and experience.
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Google Desktop Search plug-in

Post by jonib »

Hi

I´m trying to make a plug-in to search with Google Desktop Search and javascript seemed like an easy way to start, I got the interface to google to work fast.

But now I can't find how to just make a simple window with a listbox or something else to put the results from a google search.

Is there other documentation in english for SHPCE other then this as it seems outdated?
Or example scripts that use something similar to what I want to make?
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

jonib
Well, SHPCE is a dead plugin now. Use Far.NET3, then I can ask the author to come here and he might help you.
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

t-rex wrote:jonib
Well, SHPCE is a dead plugin now. Use Far.NET3, then I can ask the author to come here and he might help you.
Thanks t-rex.

I'm trying the JavaScript example for Google Desktop Search in Far.NET3 and I need to change how it reads the Windows registry.

The example used this:
var shell = new ActiveXObject("WScript.Shell");
cookie = shell.RegRead("HKCU\\Software\\Google\\QueryAPI_Samples\\Cookie");

How do I do this in Far.NET3?
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

Looking at the XML documentation I found "RegistryKey" that seems to be what I want but this does not work:
cookie = RegistryKey.GetValue("HKCU\\Software\\Google\\QueryAPI_Samples\\Cookie");
I get this error: error JS1246: Type 'Microsoft.Win32.RegistryKey' does not have such a static member
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

This seems to be the right command:
cookie = Registry.GetValue("HKEY_CURRENT_USER\Software\Google\QueryAPI_Samples", "Cookie");

It compiles but I don't get it to show up in the plugins list, I put this:
function Connect(){
this.menuItem=Far.RegisterPluginsMenuItem("Google Desktop Search", this.item_OnOpen);
}
from the MinHello.js example but it does not show up :(
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

OK now it shows up in the plugins list, I had to move the .dll up one directory level.
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

I had todo one more change to get the Google Javascript example to work, I had to put back the double backslashes that I removed by mistake:
cookie = Registry.GetValue("HKEY_CURRENT_USER\\Software\\Google\\QueryAPI_Samples", "Cookie");

Now the example works in Far.NET3 great, now lets see if I can get the rest to work too.
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

Well now I am where I was when I posted the original message only using Far.NET3, I want to make a window and put a listbox that I can put the results from Google in but can't find a way in the docs or an example.

Now would be a good time to give me some tips :oops:
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

jonib
I told the author to come by, I hope he will.
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

t-rex wrote:jonib
I told the author to come by, I hope he will.
Thanks t-rex.
nightroman
Posts: 15
Joined: Wed Mar 14, 2007 3:23 am

Post by nightroman »

Hi jonib,

At first I would recommend you to take one more plugin: PowerShellFar.

I am not proposing to use PowerShell for your task (though I am almost sure that it is possible), perhaps you don't even have PowerShell installed at all. No problem. Just take a look at the source code of the plugin - it is completely based on Far.NET3 itself. Perhaps you need just menus, then see how IMenu is used there in several places. If you really need a list box in a dialog then take a look at the script Test-Dialog-.ps1 - it contains examples of all available dialog controls including a list box. Yes, it is in PowerShell. But I believe that it is just a technical task to "translate" it into any .NET language. PowerShellFar contains an example of a dialog, too, but it is very basic (on the other hand it is in C#, perhaps it is better for you, so look at class UserInputPowerShell creating a dialog).

If you need more help, please, do not hesitate to ask.
mugz
Posts: 2
Joined: Wed Mar 14, 2007 9:24 pm

Post by mugz »

By the way, JS.Net can interpret such code:
var shell = new ActiveXObject("WScript.Shell");
cookie = shell.RegRead("HKCU\\Software\\Google\\QueryAPI_Samples\\Cookie");
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

mugz wrote:By the way, JS.Net can interpret such code:
var shell = new ActiveXObject("WScript.Shell");
cookie = shell.RegRead("HKCU\\Software\\Google\\QueryAPI_Samples\\Cookie");
What do you mean? It did not work before I changed it, what is JS.Net?

Edit: I tested it again with that code and now it works, I don't remember what error I got before but when I changed it I got it working, I'm puzzled :?
mugz
Posts: 2
Joined: Wed Mar 14, 2007 9:24 pm

Post by mugz »

JScript.Net is a compiler for a JScript for Microsoft .NET use google to find introductory materials.
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

I think it was this "WScript.Quit(-1);" that gave Me an error "error JS1135: Variable 'WScript' has not been declared" and I assumed it was the part that I changed. :oops:
Locked