From: Digest To: "OS/2GenAu Digest" Date: Sat, 2 Aug 2008 00:00:35 EST-10EDT,10,1,0,7200,4,1,0,7200,3600 Subject: [os2genau_digest] No. 1685 Reply-To: X-List-Unsubscribe: www.os2site.com/list/ ************************************************** Friday 01 August 2008 Number 1685 ************************************************** Subjects for today 1 Re: Tesseract : Alan Duval 2 Re: Tesseract : Peter Moylan 3 Plug-in ODF converter for DeScribe? : John Angelico" **= Email 1 ==========================** Date: Fri, 01 Aug 2008 14:12:50 +1100 From: Alan Duval Subject: Re: Tesseract Dennis Nolan wrote: > Alan > > It could be done by associating tif files to your OCR program. > Unfortunately this will associate all tif files with the OCR program. > > A better way is to create a Program object on your desktop. There is a > Program Object template in the Templates folder. > Make your OCR program the Object. From Memory you just need to drag it > to the Object when creating it. > During the creatioin you need to specify the dropped file as the input > parameter. The Help file that you can access in the program object > explain how to do this. > > If it is set up correctly you only need to drag and drop your tif > files on the object for it to do its stuff. I can drag and drop my tif files on the program object that I created and it will process it and save it to C:\OCR. > There is a way to get it to open your word processor too, but it's > been too long for me to clearly remember how I used to do it. That's what I now want but can't see how to do it. I can drag and drop the txt file that has been created on to the word processor object and it opens in the word processor but I would like that to happen without doing this second drag and drop. > When set up you can select multiple files and drop them on the program > object. A window for each dropped file will be created and closed when > it is finished. > You can also specify which directory to write the output file to. > > Regards > Dennis. > > > Alan Duval wrote: >> Voytek Eymont wrote: >>> >>> >>> >>>> >>>> >>>> >>>> >>>>> Program field: C:\OCR\tesseract.exe >>>>> Parameters: image[N1].tif [N2] >>>>> Working directory: C:\OCR >>>>> >>>>> >>>>> >>>>> Now when I click on the program object a window comes up asking >>>>> for the >>>>> value of N1 which I type in and press enter. Then the same >>>>> happens for >>>>> N2 >>>>> and the image is processed. With my word processor opened I can then >>>>> open the file and correct any mistakes. >>>>> >>>>> Kris suggests that a REXX program could be written to simplify >>>>> further >>>>> the process. AS I don't know REXX I wonder whether someone could >>>>> help? >>>>> >>>> so, N1 is say '123' and, N2, corresponding text file like '123.txt' >>>> so, do >>>> you just want to process *.tiff into likewise named txt, is this the >>>> general idea ? >>>> >>> >>> actually, wouldn't 'runfor' do it for you ? >>> >>> runfor Ver 1.9 - Run a command - Mar 31 1998, W. Kim >>> >> Hi again Voytek, >> >> It probably would but whatever I do it still seems that I would have >> to enter values. I would like to just double click on a saved " >> image***.tif " file and have it open as text in a word processor >> much like one can click on an attachment to an Email and have it >> opened in a word processor. >> The best solution I have so far is that above. So if I scan an >> article and it is saved as "image123.tif ." I then click on my >> program object and a window comes up requesting the values for N1. I >> would type "123 " and then a second window would come up requesting >> the values for N2. I would again type " 123 " and the resulting " >> 123.txt " file would be placed in " C:\OCR ". With a word processor >> I can then open the file and process it further. >> One can make a program or command that will work for a specified >> *.tif file but it has to work for any *.tif files as I may be >> scanning many pages. >> >> Regards, >> >> Alan ---------------------------------------------------------------------------------- **= Email 2 ==========================** Date: Fri, 01 Aug 2008 15:31:20 +1000 From: Peter Moylan Subject: Re: Tesseract Alan Duval wrote: > Dennis Nolan wrote: >> A better way is to create a Program object on your desktop. There is a >> Program Object template in the Templates folder. >> Make your OCR program the Object. From Memory you just need to drag it >> to the Object when creating it. >> During the creatioin you need to specify the dropped file as the input >> parameter. The Help file that you can access in the program object >> explain how to do this. >> >> If it is set up correctly you only need to drag and drop your tif >> files on the object for it to do its stuff. > > I can drag and drop my tif files on the program object that I created > and it will process it and save it to C:\OCR. > >> There is a way to get it to open your word processor too, but it's >> been too long for me to clearly remember how I used to do it. > > That's what I now want but can't see how to do it. I can drag and drop > the txt file that has been created on to the word processor object and > it opens in the word processor but I would like that to happen without > doing this second drag and drop. I haven't tried this (I don't even have Tesseract), but I think what you need to do is write a simple Rexx script that does three things in sequence: - parse its program argument to decompose the file name, so as to construct the arguments for the next two steps - call Tesseract - call the word processor For someone who is not familiar with Rexx (I don't know whether you are), the only hard part is the parsing of the file name, and even that is easy once you look up the Rexx manual because Rexx has an explicit PARSE command. The rest is just like writing a batch file. Suppose this script is called "script.cmd". Then you can create a program object which has the program name specified as "CMD.EXE" (without the quotes), and the parameter string "/C SCRIPT.CMD" (also without the quotes). The working directory should be the directory where script.cmd lives. Alternatively, you can give a full path specification for script.cmd, and set the working directory to be where you want your data files to live. That part is not particularly important, because you can always include CD (i.e. change directory) commands in your script, or use full path names for every file that has to be mentioned. On further thought, it's possible that the parameter string in the program object should be something like "/C SCRIPT.CMD %1", or something similar, to ensure that the parameter is passed to the script. I can't check that now because I don't have OS/2 at work. -- Peter Moylan http://www.pmoylan dot org peter at pmoylan dot org ---------------------------------------------------------------------------------- **= Email 3 ==========================** Date: Fri, 01 Aug 2008 21:19:57 +1000 (AEST) From: "John Angelico" Subject: Plug-in ODF converter for DeScribe? Hi all. Has anyone given any thought to porting a file converter to/from ODF for use under eCS-OS/2? Or does anyone know if such a beast exists in say the FOSS world? I dearly love DeScribe, and would be interested in a decent file converter that could be run in a Rexx Macro. If I could see a file as ODF in DeScribe, I could convert most MS-Word docs into ODF using OO for OS/2, then take them into DeScribe to work with them properly - in a decent word processor. Gee, I could probably do the same at work (on WinXP) as well! .... well, I can dream a little, can't I? Best regards John Angelico OS/2 SIG os2 at melbpc dot org dot au or talldad at kepl dot com dot au ___________________ ----------------------------------------------------------------------------------