Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. function getSelectionText(input) {
  4. var text = "";
  5. if (input.getSelection)
  6. {
  7. text = input.getSelection().toString();
  8. }
  9. else if (input.document.selection && input.document.selection.type != "Control")
  10. {
  11. text = input.document.selection.createRange().text;
  12. }
  13. return text;
  14. }
  15.  
  16. var extInput = external.menuArguments;
  17.  
  18. var selected = getSelectionText(extInput);
  19.  
  20. var oShell = new ActiveXObject("Shell.Application");
  21.  
  22. var commandtoRun = "MyFileLoc";
  23.  
  24. oShell.ShellExecute(commandtoRun,"""+selected+""","","open","1");
  25.  
  26. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement