2 Replies Latest reply on Nov 18, 2010 8:26 AM by Supermonkey99

    Custom Menu Item to Launch Executable

    Supermonkey99

      Hi, I'm wondering if its possible to have a custom menu item (Adobe Reader 8.1.2) which will run an executable piece of code when clicked. I was hoping to do this to enable PDF documents to be saved to an imaging and workflow system - in order to save into this, I need to run an executable which prompts the user to input some information before saving the document to this system so other users can access it.

       

      I've only got as far as having my menu item appear but can't get it to actually run any code. I suspect this might not be possible due to it being Javascript that's used, but just wonder if someone could perhaps confirm? For example, the Javascript below shows my menu item, says 'hello' when clicked but then gives me an error saying 'An internal error has occurred'.

       

      app.addMenuItem({
      cName: "Save To Imaging",
      cParent: "File",
      cExec: "run()",
      nPos: 7});

       

      function run()
      {
      app.alert('hello');
      var shell = new ActiveXObject("WScript.Shell");
      shell.run('C:\Temp\Test.exe');
      }

      Any pointers would be much appreciated.

       

      Thanks