Welcome Guest.   Make a donation to an author on the site December 18, 2014, 12:24:40 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: CHM2Alias  (Read 4437 times)
ewemoa
Honorary Member
**
Posts: 2,520



View Profile Give some DonationCredits to this forum member
« on: March 01, 2010, 05:31:30 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:17 PM by ewemoa » Logged
phitsc
Honorary Member
**
Posts: 1,023



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #1 on: March 01, 2010, 06:13:12 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.
Logged

ewemoa
Honorary Member
**
Posts: 2,520



View Profile Give some DonationCredits to this forum member
« Reply #2 on: March 01, 2010, 06:19:25 AM »

Thanks for the report.

I will investigate smiley
Logged
ewemoa
Honorary Member
**
Posts: 2,520



View Profile Give some DonationCredits to this forum member
« Reply #3 on: March 01, 2010, 06:21:34 AM »

Could you try running the .exe from a path with no spaces?
Logged
ewemoa
Honorary Member
**
Posts: 2,520



View Profile Give some DonationCredits to this forum member
« Reply #4 on: March 01, 2010, 06:47:06 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.
Logged
phitsc
Honorary Member
**
Posts: 1,023



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #5 on: March 01, 2010, 03:15:30 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.
Logged

mouser
First Author
Administrator
*****
Posts: 33,770



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: March 01, 2010, 05:53:49 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.
Logged
ewemoa
Honorary Member
**
Posts: 2,520



View Profile Give some DonationCredits to this forum member
« Reply #7 on: March 01, 2010, 08:25:02 PM »

Aha.  Thanks phitsc for further testing and mouser for the explanation smiley

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:43 PM by ewemoa » Logged
phitsc
Honorary Member
**
Posts: 1,023



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #8 on: March 02, 2010, 04:06:16 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 Wink.

Logged

ewemoa
Honorary Member
**
Posts: 2,520



View Profile Give some DonationCredits to this forum member
« Reply #9 on: March 02, 2010, 04:23:12 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 smiley
Logged
phitsc
Honorary Member
**
Posts: 1,023



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #10 on: March 02, 2010, 05:09:19 AM »

It was the browser cache. Sorry about that. embarassed
Logged

ewemoa
Honorary Member
**
Posts: 2,520



View Profile Give some DonationCredits to this forum member
« Reply #11 on: March 02, 2010, 05:44:06 AM »

No problem.

I presume then that it is working and I am happy about that smiley
Logged
phitsc
Honorary Member
**
Posts: 1,023



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #12 on: March 02, 2010, 05:56:26 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 Wink
Logged

ewemoa
Honorary Member
**
Posts: 2,520



View Profile Give some DonationCredits to this forum member
« Reply #13 on: March 02, 2010, 10:02:22 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 smiley

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:

Formatted for Javascript with the GeSHI Syntax Highlighter [copy or print]
  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).
Logged
phitsc
Honorary Member
**
Posts: 1,023



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #14 on: March 02, 2010, 10:11:32 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 smiley
I wasn't suggesting that my suggestion could be implemented quickly Wink
Logged

mouser
First Author
Administrator
*****
Posts: 33,770



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: March 02, 2010, 01:21:52 PM »

this is really cool -- do i have permission to use it to make a farr help alias to include with farr?
Logged
ewemoa
Honorary Member
**
Posts: 2,520



View Profile Give some DonationCredits to this forum member
« Reply #16 on: March 02, 2010, 04:15:33 PM »

LOL - to both responses smiley

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.
Logged
ewemoa
Honorary Member
**
Posts: 2,520



View Profile Give some DonationCredits to this forum member
« Reply #17 on: March 03, 2010, 07:23:43 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...
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.043s | Server load: 0.1 ]