I have a .js that selects some texts and starts a C# program parsing the selected text into Main() as arguments. I want to know is there anyway that .js can parse text into an existing instance of a Winform program. For example, display the selected text into a rich text box.
This is my current implementation:
<script type="text/javascript">
function getSelectionText(input) {
var text = "";
if (input.getSelection)
{
text = input.getSelection().toString();
}
else if (input.document.selection && input.document.selection.type != "Control")
{
text = input.document.selection.createRange().text;
}
return text;
}
var extInput = external.menuArguments;
var selected = getSelectionText(extInput);
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "MyFileLoc";
oShell.ShellExecute(commandtoRun,"\""+selected+"\"","","open","1");
</script>