Page 1 of 1

How build Python Extention for OpenOffice Writer

Posted: Wed Jun 21, 2017 4:04 pm
by karpo518
I used "Basic Addon Builder" for basic macros. How i can to pack python macros?

Re: How build Python Extention for OpenOffice Writer

Posted: Wed Jun 21, 2017 7:36 pm
by Villeroy
Well, in most cases a JavaScript/Python macro is just a plain text file (module) saved in some subdirectory of the user profile.
An extension may include some macro code but macros are not the same as an extension. Instead of wasting my time with this horrible extension framework, I wrote a very simple script installer. It is a Writer template with a user-defined variable, a modified "Default" paragraph style, a frame with a button and a Basic macro.
Just replace the placeholder field with your code and adjust the user-defined variable "ScriptPath" by double-clicking the field in the text frame.

P.S. The extension compiler can compile extensions with all kinds of scripts. I hate that framework so much that I did not even spend any time with that helpful tool.

Re: How build Python Extention for OpenOffice Writer

Posted: Thu Jun 22, 2017 3:35 pm
by karpo518
My macro is a single file, but i need addition functions of extention.

i need:
1. set version and description
2. set custom icon in top panel for running macros
3. set update URL

Can anyone share a compilation code template for my case(or any example code)? I mean basic code for extension compiler.

Re: How build Python Extention for OpenOffice Writer

Posted: Thu Jun 22, 2017 4:00 pm
by Villeroy

Re: How build Python Extention for OpenOffice Writer

Posted: Tue Jul 18, 2017 7:54 pm
by nostarch
Hi. I've just registered for this board because we need some help automating our workflow from OpenOffice to Adobe InDesign. I can't PM so I'm dropping this message off here.

I'm trying to find someone to hire to automate, for example, the import of automated cross references from OOo to InDesign. Villeroy, I see that you often post about technical topics and I wonder whether this is the sort of thing you might be interested in.

You can reach me directly at bill-at-nostarch-dot-com

Thank you,

Bill Pollock, No Starch Press

Re: How build Python Extention for OpenOffice Writer

Posted: Wed Jul 19, 2017 9:59 am
by karpo518
Problem does not solved. I got error, when i run macros for compilation. http://joxi.ru/J2bNx90IXWkN42. What is that means?

Code:

Code: Select all

REM  *****  BASIC  *****

Option Explicit

Sub exampleDescription
  beginDescription("PlainToHTMLNew", "1.0.0")
    setExtensionDescription("en")
    setPublisherName("en", "Alexey Tyapkin", "http://www.oooyes.com")
    setDisplayName("en", "PlainToHTMLNewDisplayName")
    beginUpdateInformation("direct", "direct") 
  	setUpdateSource("http://otp.tw1.ru/PlainToHTML2/", "http://otp.tw1.ru/PlainToHTML2/") ' first choice
    endUpdateInformation
  endDescription  

  beginAddonUI
    beginAddonMenu
      beginCommand
        beginTitles("Writer")
          setTitle("This is an apple", "en")
        endTitles
         setURL("Python", "PlainToText2.py", "PlainToHtml")
        setImage("icon.png")
      endCommand
    endAddonMenu
  endAddonUI

End Sub

Re: How build Python Extention for OpenOffice Writer

Posted: Tue Aug 01, 2017 2:21 pm
by LibreOfficiant