heezy has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I'm trying to create a bridge between two programs.

I understand that the details of passing parameters to a Star Office macro is off topic as far as Perl is concerned, but I'm hoping that there is some Perl-ish way of doing this or that people may of done before when communicating with other programs?

Program I
********

This is a CGI script writen in Perl that uploads files from the users computer (.pdf, .html & .sxw) to the web server and performs numerous checks on the files (titles, META info, etc..) If approved these files are then stored in a directory awaiting processing on the server.

Program II
*********

This is a Star Office 6 macro that takes a directory and a date in the format ddMmmyyyy as run time parameters specified in a user input box, and converts all Star Office 6 (.sxw) files into .ps & .html format saving them back to the same directory.

Here's the cruch part... I want to get program one (Perl) to make the Star Office macro convert all files in a given directory. (So a user does not have to load Star Office everytime, start the macro, specify the directory, wait for the files to convert..)

I need to know how to pass these two parameters (directory and date) to the Star Office Macro so it can run in the back ground on the server converting the files without the web user intervening in any way. Is this possible?

Any insight would be great,

Thanks all

M

Replies are listed 'Best First'.
Re: Perl & Star Office Integration
by MZSanford (Curate) on Oct 17, 2002 at 21:07 UTC

    I have never worked with StarOffice from perl, but here are a few thoughts ...

    • If this is Windows, see if StarOffice has an OLE interface (i think it does), and check out Win32::OLE.
    • (non-perl) Use a GUI macro recorder. (available for both Win and X)
    • use the C-API for the macros, some XS magic, and make many monkly friends. :)

    from the frivolous to the serious
Re: Perl & Star Office Integration
by Anonymous Monk on Oct 21, 2002 at 17:30 UTC
    You may want to consider using an external application to convert the files such as http://api.openoffice.org/source/browse/api/odk/examples/java/DocumentConverter/ and then simply calling the external java program to do as you desire. I think that there are probably some better solutions but I do not recall them off hand! Andrew PItonyak andrew @ pitonyak . org

      Thanks Anonymous Monk! I'll look into it...

      M