[SOLVED] Opening .chm in Dreamweaver custom menu.

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

[SOLVED] Opening .chm in Dreamweaver custom menu.

Post 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");
  }
}
Last edited by Jade on Sat Oct 21, 2006 3:20 pm, edited 2 times in total.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Post 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.
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Post by Jade »

Post Reply