topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday December 10, 2024, 8:34 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: CHM2Alias  (Read 13655 times)

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
CHM2Alias
« on: March 01, 2010, 05:31 AM »
CHM2Alias

This (still very alpha) tool attempts to create a FARR .alias file from a .chm file.  The resulting alias consists of results that point to specific nodes within the .chm file.

Thus, FARR's searching/filtering capabilities may be applied to quickly navigate to certain places within .chm files for which corresponding .alias files have been created, installed, and configured.

How to Use

Basically the tool is applied to an existing .chm file to create a new .alias file.  The resulting .alias file should be placed in an appopriate location and then possibly tweaked via FARR's UI.  Detailed instructions follow.

At the moment, your machine must have hh.exe living in C:\WINDOWS\ for this tool to work.

Creating the new .alias file.

1. Drop a .chm file on to CHM2Alias.exe.

There should be a new .alias file in the same directory as CHM2Alias.exe.

Installing the new .alias file.

2. For Windows XP, the new .alias file should be placed in the folder:

  <FARR-Installation-Dir>\AliasGroups\MyCustom\

where <FARR-Installation-Dir> is typically:

  C:\Program Files\FindAndRunRobot

but may be somewhere else depending on your setup.

For Vista / 7, the new .alias file should typically be placed in:

  C:\Users\<username>\Documents\DonationCoder\FindAndRunRobot\AliasGroups\MyCustom\

where <username> is your user name.

Configuring the new .alias file.
  
3. Open FARR's Options window and navigate to:

  Program Options ->
    Lists ->
     Aliases/Groups
      
Then choose the new .alias via the combo box labeled:

  Select Alias/Group file to configure
  
4. Bring up the "Edit Group/Alias" dialog for the single entry by double-clicking the entry or via its context-sensitive menu.

5. Edit any values appropriately -- specifically, choosing a relatively short value for Group Alias Name is recommended.

Using the new alias.

6. Bring up FARR and type the alias' value for Group Alias Name.

Temporary Download
« Last Edit: March 01, 2010, 08:42 PM by ewemoa »

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #1 on: March 01, 2010, 06:13 AM »
Have hh.exe in my c:\windows directory. Dropping FindAndRunRobot.chm onto CHM2Alias.exe gave me the following error:

[CHM2Alias.exe]
JavaScript main() returned: Execution of main failed: undefined.

I now have an empty directory called 'radA6319.tmp' in the CHM2Alias folder as well as a debuglog.txt file containing the following:

Mon Mar 1 13:08:17 UTC+0100 2010: e.message: undefined
Mon Mar 1 13:08:17 UTC+0100 2010: argc: 2
Mon Mar 1 13:08:17 UTC+0100 2010: argv: C:\Program Files\FindAndRunRobot\FindAndRunRobot.chm,0
Mon Mar 1 13:08:17 UTC+0100 2010: cwd: C:\Documents and Settings\ttt\My Documents\Downloads\CHM2Alias


I also tried Notepad++'s .chm file. Same result.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #2 on: March 01, 2010, 06:19 AM »
Thanks for the report.

I will investigate :)

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #3 on: March 01, 2010, 06:21 AM »
Could you try running the .exe from a path with no spaces?

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #4 on: March 01, 2010, 06:47 AM »
I was able to reproduce similar results.

I have uploaded a version which seems to fix the issue locally.

Thanks again for the report -- I hope the fix is effective.

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #5 on: March 01, 2010, 03:15 PM »
Alias file creation worked fine now on my home PC with Windows 7 (with your updated version).

It's not in the combo box though once I copied it into 'C:\Program Files\FindAndRunRobot\AliasGroups\MyCustom' and I can't find where the myaliases.alias file is either (to copy the file there). Maybe a Windows 7 issue. I'm too tired to look for the problem now. I'll check it out tomorrow on my Windows XP PC (in the office) and I'm sure I'll find out where to place it on Windows 7 later.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: CHM2Alias
« Reply #6 on: March 01, 2010, 05:53 PM »
On Windows Vista/7, the AliasGroups/MyCustom subdir is under the user's MyDocuments path, because its a directory the user needs write-access to.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #7 on: March 01, 2010, 08:25 PM »
Aha.  Thanks phitsc for further testing and mouser for the explanation :)

Perhaps I should update the instructions...

I have updated the instructions (and uploaded an updated version) -- if anyone finds they are in error, please let me know.
« Last Edit: March 01, 2010, 08:53 PM by ewemoa »

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #8 on: March 02, 2010, 04:06 AM »
Still get the same error when the CHM2Alias.exe is in a path with spaces. Without spaces it works perfectly.

And it is very cool! :Thmbsup:

A more automatic way of creating, installing, configuring and especially updating such an alias file would obviously be desirable ;).


ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #9 on: March 02, 2010, 04:23 AM »
Thanks for your continued testing and feedback  :Thmbsup:

I have not had luck reproducing the issue with (what I think is) the latest version available for download:

  File Size: 256,216 Bytes
  SHA1: 9a32d5d3670ac0356efd9dd483d3f1fbead0c488

Would you mind confirming that those values are what you see for the .zip file you tested with?  Those are the characteristics of the .zip file from which I just tried with -- that's what I asked FF to download (but sometimes I get cached versions) -- and it's possible I'm not testing with the right version.  (I also tried downloading with IE and got the same results, FWIW.)

To explain what I think the issue is (or at least one of the problems is) -- hh.exe doesn't seem to work well with paths surrounded with double-quotes, so what I did was to pass 8.3 names (thanks to a suggestion from mouser) to hh.exe.  The README.txt now has some instructions in it describing this along with steps for reproduction in case you'd like to see for yourself.

The invocation of hh.exe is done via the chm2hhc.js file -- nearly all of the code is provided via JavaScript in source form, btw, if you happen to be inclined to take a look (and tweak even).

I agree that a more automatic way of creating, installing, configuring, and updating would be desirable.  If you have any ideas about any of those things, I would welcome discussion :)

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #10 on: March 02, 2010, 05:09 AM »
It was the browser cache. Sorry about that. :-[

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #11 on: March 02, 2010, 05:44 AM »
No problem.

I presume then that it is working and I am happy about that :)

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #12 on: March 02, 2010, 05:56 AM »
It does indeed!

Concerning ideas of making it simpler to use. I'm dreaming something up:
- "Start" CHM2Alias
- It presents me a list of all .chm files in "Program Files"
- The ones which I have already "created/installed" are marked somehow
- I can select a few of them and press the 'Create / Update' button
- Each one also lists the group alias name which I can change right there

So when I install a new application or update one I'll just start CHM2Alias again and select the new app / the app I updated and press the 'Create / Update' button again.

As a quick improvement I would suggest to name the group alias name without the 'chm' at the end ;)

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #13 on: March 02, 2010, 10:02 AM »
Thank you for confirming that the tool is working and your thoughts on making the tool simpler to use.

It is perhaps beyond my current AHK capabilities to quickly implement your suggestions -- however, I now have more motivation to learn about how these things might be done :)

Also, I have updated my local source to remove the 'chm' from the group alias name.  Thanks for this idea also.  

If you would like to see this change in your local version (and haven't carried it out already), the file to edit is map2aliasfile.js, and code here now looks like:

Code: Javascript [Select]
  1. // XXX: auto-naming is hard... ?
  2.     ts.WriteLine("        <AliasText>" + bname + "</AliasText>");
  3.     ts.WriteLine("        <Score>1000</Score>");

It is the 2nd line which is different.


P.S. In case it has sounded confusing, a portion of this program is written in AHK, and the rest is written in JScript (plus a tweak to make it possible to #include code from other files).

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #14 on: March 02, 2010, 10:11 AM »
It is perhaps beyond my current AHK capabilities to quickly implement your suggestions -- however, I now have more motivation to learn about how these things might be done :)
I wasn't suggesting that my suggestion could be implemented quickly ;)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: CHM2Alias
« Reply #15 on: March 02, 2010, 01:21 PM »
this is really cool -- do i have permission to use it to make a farr help alias to include with farr?

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #16 on: March 02, 2010, 04:15 PM »
LOL - to both responses :)

phitsc: naively I was thinking that it wouldn't be hard for an AHK guru...but I guess according to Fred Brooks, all programmers are optimists...

mouser: please feel free to use it as such -- as far as I'm concerned, no permission necessary.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: CHM2Alias
« Reply #17 on: March 03, 2010, 07:23 AM »
Regarding easier access to one's MyCustom alias directory...

I made an alias with the following result:

  %CONFIGDIR%\AliasGroups\MyCustom

Using this alias, FARR opens my MyCustom aliases directory.  I guess CHM2Alias could provide this alias...