help with context menus
Posted by: burt
Date: November 15, 2011 10:04PM

Hello,

I managed to design a right click context menu addition to IE, where I can highlight a phone number (i.e. text) on a webpage and choose "PHONE" which copies the phone number to the clipboard and then executes phone dialer and pastes the phone number into the dialer's window, then hits dial button, which makes the call.

It required creating 2 "hidden" html documents, one whose title appeared in the right click menu, which copied the highlighted phone number to the clipboard and then "opened" the second html document

<script language="javascript"type="text/javascript">
{var SelectedText =window.external.menuArguments.document.selection.createRange().text;
window.clipboardData.setData("Text",SelectedText);}
window.open('C:/numba.htm',"mywindow","menubar=0,statusbar=0,toolbar=0,scrollbars=0,location=0,center=0,resizable=0,width=1,height=1,left=400,top=250");
var wsh = new ActiveXObject('WScript.Shell');
wsh.SendKeys ("{TAB}");
wsh.SendKeys ("{ENTER}");
</SCRIPT>

The second html document, executed the dialer program and then pasted the clipboard to it and hit the dial button, all using SendKeys.

<script language="javascript"type="text/javascript">
var wsh = new ActiveXObject('WScript.Shell');
wsh.Run("C:\\WINDOWS\\Dialer.exe");
setTimeout("wsh.Sendkeys ('^V')",250);
setTimeout("wsh.Sendkeys ('{ENTER}')",260);
setTimeout("wsh.Sendkeys ('%{F4}')",8500);
setTimeout("wsh.Sendkeys ('%{F4}')",8600);
setTimeout("wsh.Sendkeys ('%{F4}')",8800);
</SCRIPT>


I have no idea how to do this in K-meleon.

Adding to context menus in IE involves adding to the folder "MenuExt" in the registery. How do I add to the right click context menus in K-meleon?

Any help would be greatly appreciated.

Thank you
Burt

Re: help with context menus
Posted by: JamesD
Date: November 16, 2011 12:40AM

This will show how to add an item to a context menu. It is not fully automatic. There is a MacroLanguage for K-Meleon. See this: http://kmeleon.sourceforge.net/wiki/MacroLanguage2 There is also a list of command ID's. See this: http://kmeleon.sourceforge.net/wiki/CommandIDs

There may be an extension which will do what you need. Check this: http://kmext.sourceforge.net/

You can execute "wscript.exe" from a macro and pass command line arguments to it. I did not go that far yet. In this little demo I just allow the user to highlight the phone number and right click to open Dialer.exe. You still have to paste the number and click "dial".

In your profile there is a folder named "macros". Copy the following code (different font) and put it into Notepad and give the filename that is in bold type. Be careful to select all files instead of text when saving from Notepad so the file extension will be kmm instead of txt.

You can find the path to your profile folder by using EDIT - CONFIGURATION - PROFILE DIRECTORY. After you put the macro named "DialOut.kmm" into your profile, restart KM, highlight a phone number, and right click.

DialOut.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)
#  
# ---------- DialOut.kmm
# ---------- K-Meleon Macro Language   ---------------
#
# Dependencies        : - main.kmm, Dialer.exe
# Resources           : - 
# Preferences         : - 
# Version             : - 0.1   2011_11_15
# --------------------------------------------------------------------------------

_DialOut_GSelect {
macroinfo = _("Copy selected text to clipboard for entering to Dialer.exe.");
id(ID_EDIT_COPY );
exec("Dialer.exe") ;
}

_DialOut_ModMenu {
setmenu("SelectedText",macro,_("Send to DialOut"),"_DialOut_GSelect",-1);
}

# - - - - - - - - - - - - - - - - - - - - - - 
$OnInit=$OnInit."_DialOut_ModMenu;";
$macroModules=$macroModules."DialOut;";

Hanlon’s razor is an eponymous adage named after Robert J. Hanlon that states: “Never attribute to malice that which is adequately explained by stupidity.”

JamesD

K-Meleon forum is powered by Phorum.