Welcome Guest.   Make a donation to an author on the site November 26, 2014, 06:46:43 AM  *

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: Configuring user tools  (Read 7700 times)
rjbull
Charter Member
***
Posts: 2,788

View Profile Give some DonationCredits to this forum member
« on: May 02, 2007, 10:09:46 AM »

Mouser,

Should the Configure User Tools menu be part of the main Options screen?

Please can you give an example of how to configure something, and how the macros work - how they relate to what the external tool wants to see?

Can you set up something that expects to read and write via standard input/output, rather than a file?

Logged
mouser
First Author
Administrator
*****
Posts: 33,699



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: May 02, 2007, 10:24:06 AM »

great questions -- it's been so long since anyone actually inquired about user tools..

regarding the "macros" -- the basic idea is this.
when invoking a user tool, CHS:
1) creates a temp file with current clip contents; the full path to this file is %infile%.
2) thinks up a name for a temporary output file where it expects the changed clip to be stored; the full path to this is %outfile%.
3) invokes your tool with commandline you specify
4) it then looks in the %outfile% file to grab the new contents.

SO,
basically lets say you wanted to make a perl script to do lots of processing on some text, to clean it up.
you would make your script take 2 parameters, the input file and output file, and then youd pass them on the commandline when you configure your tool via CHS, like so:

myscript.exe "%infile% "%outfile%'

---

ok you asked about commandline input and output; right now its not supported, though you could very easily simply use a .bat file to execute whatever command you want that outputs to commandline and rout it to outfile, which is the easiest way to do it.

--

addendum:
im not sure now whether %infile% and %outfile% have the complete paths in them or whether the complete paths are specified by "%tmpdir%/%infile%" and "%tmpdir%/%outfile%" which now seems more likely looking at the tool properties screen.

---

im happy to talk more over email to help you get things working and i'd appreciate a summary if/when you do get something working right, so i can update the help file with any lessons learned.. i think it's a nice feature in CHS but no one uses it so it's got very little testing.  if there are issues i'm happy to try to improve it for the one user of it (you!). smiley
Logged
rjbull
Charter Member
***
Posts: 2,788

View Profile Give some DonationCredits to this forum member
« Reply #2 on: May 03, 2007, 09:22:01 AM »

OK, thanks, Mouser.

I had trouble with the command-line app I was trying to use, so I put it into a batch file.  The batch seems to work from the command line, but, it doesn't work from inside CHS and even putting a PAUSE statement in the batch didn't stop the window closing before I could read it.  So I wrote a TEST.BAT thus:

echo %1 > c:\zdir\testbat.log
echo %2 >> c:\zdir\testbat.log
pause

and put it into CHS with only %infile% and %outfile% as arguments.  This time the Pause did work.  The contents of testbat.log are:

"C:\Program Files\Clipboard Help+spell\tmpin.txt"
"C:\Program Files\Clipboard Help+spell\tmpout.txt"

Even in quote marks, are plus signs legal in file or directory names?  I thought they were reserved for concatenation.

Logged
mouser
First Author
Administrator
*****
Posts: 33,699



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: May 03, 2007, 09:28:33 AM »

plus is legal.  thats the full path to the program "C:\Program Files\Clipboard Help+spell\", so it looks like it is working exactly as it should.
Logged
rjbull
Charter Member
***
Posts: 2,788

View Profile Give some DonationCredits to this forum member
« Reply #4 on: May 04, 2007, 10:56:03 AM »

Oh yes, I should have spotted that CHS' directory had a plus sign.   I knew the program name was  ClipboardHelpAndSpell  in words.  OK, I'll take another look.

<later>

Are you certain that CHS does actually produce a tmpin.txt?  I've tried running the temprun.bat that CHS makes externally, which works OK if I manually make a tmpin.txt file first, but if I try from CHS' User tools menu, I get some kind of "command unrecognised, this isn't a file" type error window that pops up then disappears so fast I can't read it.  So I'm wondering if the command processor can't find the tmpin.txt file.



« Last Edit: May 04, 2007, 10:58:39 AM by rjbull » Logged
mouser
First Author
Administrator
*****
Posts: 33,699



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: May 04, 2007, 11:11:17 AM »

ill check and report.
Logged
rjbull
Charter Member
***
Posts: 2,788

View Profile Give some DonationCredits to this forum member
« Reply #6 on: May 15, 2007, 04:05:25 AM »

Mouser,

It does make a tmpin.txt.  Maybe I'm getting errors because owing to "security restrictions" I can't access CMD.EXE on this machine, only COMMAND.COM, and there might be a problem about passing LFNs.

Logged
mouser
First Author
Administrator
*****
Posts: 33,699



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: May 15, 2007, 12:44:30 PM »

when you pass %infile% and %outfile% make sure you put them in double quotes;
i could try setting them as short filenames if you think that will help.
Logged
rjbull
Charter Member
***
Posts: 2,788

View Profile Give some DonationCredits to this forum member
« Reply #8 on: May 16, 2007, 03:52:14 AM »

I used the macro picker, which adds double quotes itself.  Don't think I need to redouble those?

I'm limited to a COMMAND.COM shell; would that limit path length?

Logged
mouser
First Author
Administrator
*****
Posts: 33,699



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: May 16, 2007, 08:48:21 AM »

no need to double.
yes path length is limited but it's pretty long.. so i doubt that's the problem.
Logged
justice
Supporting Member
**
Posts: 1,890



Solve issues simply.

View Profile WWW Give some DonationCredits to this forum member
« Reply #10 on: May 23, 2007, 06:55:14 PM »

BTW this is ideal for something like HtmlTidy (http://tidy.sourceforge.net/) copy html and reformat it in one go! I might have a go at that.
Logged

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



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: May 23, 2007, 07:01:30 PM »

please let me know if you get it to work and if not what problems you have..
it would be nice to have a little list of tools and how to configure them somewhere, maybe start a thread for it.
Logged
oldHacker
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« Reply #12 on: May 19, 2008, 01:26:58 PM »

user tools ~ are they still available?
Logged
rjbull
Charter Member
***
Posts: 2,788

View Profile Give some DonationCredits to this forum member
« Reply #13 on: May 20, 2008, 03:32:49 AM »

user tools ~ are they still available?

I'm using CHS 1.19.02.

User tools aren't a separate download, if that's what you mean.  You get to them by bringing up CHS's main window, picking a clip, and pressing the [M]odify format/case button.  That brings up a Modify Format/Case screen with User Tools as the middle menu item.  Click that and you get Configure User Tools.  Here you enter any suitable tool you fancy.  One of mine looks like the image below.

The batch file is:

[copy or print]
c:\dos\utils\sed-359.exe -f c:\pcw\spellchk\CHS.SED < %1 > %2

and CHS.SED is just a set of search-and-replace pairs, like this:

[copy or print]
s/INTERNATIONAL BUSINESS MACHINES CORPORATION/IBM CORP\./g
s/INTERNATIONAL/INTL\./g
s/KABUSHIKI KAISHA/K\.K\./g

HTH, though I doubt it   Wink





* CHS_Tool_Properties.png (4.05 KB, 447x170 - viewed 255 times.)
« Last Edit: May 20, 2008, 03:37:37 AM by rjbull » Logged
oldHacker
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« Reply #14 on: May 20, 2008, 11:06:51 AM »

user tools ~ are they still available?

I'm using CHS 1.19.02.

User tools aren't a separate download, if that's what you mean.  You get to them by bringing up CHS's main window, picking a clip, and pressing the [M]odify format/case button...
thanks ~  Cool
Logged
mouser
First Author
Administrator
*****
Posts: 33,699



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: May 20, 2008, 11:59:11 AM »

rjbull got it right -- there are no predefined user tools to download, it's a mechanism for configuring your own commandline tools to work with CHS.

thanks for the nice example rj, i might put that in the help file if you don't mind  thumbs up
Logged
rjbull
Charter Member
***
Posts: 2,788

View Profile Give some DonationCredits to this forum member
« Reply #16 on: May 21, 2008, 03:44:16 AM »

thanks for the nice example rj, i might put that in the help file if you don't mind  thumbs up

Go ahead, mouser  smiley

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.041s | Server load: 0.04 ]