Page 1 of 1

[SOLVED] Opening .chm in Dreamweaver custom menu.

Posted: Fri Oct 20, 2006 6:31 pm
by Jade
Hey there,

I'm trying to add a new menu to Dreamweaver so that displays my .chm manuals when i click on them from the drop down menu. I've got the options added to the menu fine, the only problem I'm having is using Javascript to open the .chm file. I've tried all of the things below and none of them work. Any ideas?

Code: Select all

function receiveArguments(){
  if (arguments[0] == 'PHP'){
    window.open("file//C:\\php_manual_en.chm");
  }else {
    window.open("C:\\mysql_manual_en.chm");
  }
}


function receiveArguments(){
  if (arguments[0] == 'PHP'){
    document.location.href="C:\\mysql_manual_en.chm";
  }
}

function receiveArguments(){
  if (arguments[0] == 'PHP'){
    location.go("C:\\mysql_manual_en.chm");
  }
}



var oShell = new ActiveXObject("Shell.Application");

function receiveArguments(){
  if (arguments[0] == 'PHP'){
 // Invoke the execute method.  
 oShell.ShellExecute("C:\\mysql_manual_en.chm", "", "", "open", "1");
  }
}

Posted: Fri Oct 20, 2006 6:42 pm
by RobertGonzalez
CHM files are help files, aren't they? Have you tried your script on something like a plain text file? Just as a test I mean.

Posted: Fri Oct 20, 2006 7:19 pm
by Jade
I've tried it using a text file also. No luck.

Code: Select all

function receiveArguments(){
  if (arguments[0] == 'PHP'){
    window.open('C:\\test2.txt')
  }else {
    window.open("C:\\php_manual_en.chm");
  }
}
I get the following error even though test2.txt is in the correct location:

Code: Select all

Cannot find file:///C:/test2.txt/'. Make sure path or Internet address is correct.
When I try to run it through the shell using the activeX I get errors with activeX not being initiated. However, Dreamweaver has its own .chm files and they work fine. I tried using their code to load my .chm files with no luck.

Posted: Sat Oct 21, 2006 3:18 pm
by Jade