ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Clipboard Help+Spell

Configuring user tools

(1/4) > >>

rjbull:
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?

mouser:
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!). :)

rjbull:
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.

mouser:
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.

rjbull:
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.



Navigation

[0] Message Index

[#] Next page

Go to full version