# Revision history [back]

### Did you know that you could also easily Organize your Python scripts from within LibreOffice using APSO?

In 2012, the original code for the "Alternative Python Script Organizer" ( APSO ) was written by Hanya. Some adjustments to the code were made at that time by @Karolus. In 2016, Hubert Lambert adapted the original script and made it into an .oxt extension. The APSO extension is available on the French OpenOffice Forum, with an introduction text in French.

Since the APSO extension deserves to get a far better visibility, it is now also made available for download here on AskLibreOffice ( Scroll down for the link... ). For this purpose i tried to translate the original introduction text from Hubert Lambert into English: ( please forgive any errors in the translation that might have occurred, and correct where necessary.. )

______________ Start of translation

Managing Scripts in Python by Hubert Lambert » 09 Nov 2016 17:49

Good day to all,

[To follow up on [this thread](https://forum.openoffice.org/fr/forum/viewtopic.php?f=8&t=52689), and in particular the suggestion by Dude, i post here a part of the original message.]

Hanya, one of the most brilliant and effective contributors of the sections "Macros and API" on the English-language forum, has in 2012 proposed a script ( Alternative Python Script Organizer ) that enormously simplifies the management of Python scripts on OpenOffice or LibreOffice. I think this script deserves a far better visibilty.

To make it easier to use, i have adapted it as follows :

 - French translation of the commands and menu-items ;
- Added two commands "Embed in document" and "Export" from an existing document ( the code is but a variation of the original code by Hanya ) ;
- ( Very elementary ) implementation of the option "Edit" through which the script can be modified by the default system editor ;
- Packaging into an extension to facilitate the installation.


Once this extension is installed ( and the program is restarted just to make sure ), a new menu-item "Organise python scripts..." will appear in the submenu "Macros" of the menu "Tools".

This new menu-item opens a dialog box listing the scripts and proposing various actions :

[APSO_dialogue.png]

The button "Execute" allows you to launch the selected macro.

The available actions from the button "Menu" vary according to the selection, and they are :

 - Create a library or a module if the selection is a container ( "user", "share" or "document" ) ;
- Edit*, rename, delete a module or a library ;
- Copy a module from the application ( "user" or "share" ) to the current document ;
- Replace a module that is embedded in a document by a module that is located on the computer ;
- Export a module that is embedded in a document.
[* The option "Edit" only opens the module with the text-editor associated by default to the extension ".py". It doesn't work for scripts that are embedded inside a document.]


This version 0.2, compatible with OpenOffice and LibreOffice, also includes the following elements :

 - internationalization of the extension ( currently French and English ) ;
- Added a default keyboard shortcut ( Shift + Alt + F11 ) for quick launch ;
- a mini-library to facilitate development, which contains three functions: xray, mri and msgbox.


To access these from a script, you must have at least once launched the python scripts organizer ( to load the path ) and insert the following line:

from apso_utils import xray, mri, msgbox


( and Of course installed Xray or MRI if necessary ).

For any suggestion, question or remark, the initial thread given above seems to me the most suitable place.

Added: version 0.3 :
- addition of German and Italian ;
- correction of the code.

- addition of Hungarian ( thanks to Zizi64 ).

- added an options page that allows you to choose the editor ( based on Hanya's EditorKicker ) ;
- Opening macros on the corresponding line, if the appropriate option is set ;
- adapted the vocabulary to be consistent with the default macro manager ( following this thread ) ;
- better management of errors and accented dialogs.

- taken into account the property allowMacroExecution for embedded macros ;
- subject to providing the editing parameters, possibility of directly accessing the syntax errors from the error message;
- direct editing of embedded macros ( only in the context of the extension ).

- fixed a bug ;

- Fixes a problem ( under Windows ) when a path or document contains non-ascii characters.


______________ End of translation

A big "Thank You!" to the author, co-authors, developers, and contributors who made the APSO extension come true!

On this date ( May 21st 2017 ), the current version of the APSO extension is 0.8.3.

( just unzip the .ott file to get the .oxt file ... since .oxt is not among the permitted file types to upload )

apso_v0.8.3.oxt.ott

( a newer version might become available on the French site ...)

### Did you know that you could also easily Organize your Python scripts from within LibreOffice using APSO?

In 2012, the original code for the "Alternative Python Script Organizer" ( APSO ) was written by Hanya. Some adjustments to the code were made at that time by @Karolus. In 2016, Hubert Lambert adapted the original script and made it into an .oxt extension. The APSO extension is available on the French OpenOffice Forum, with an introduction text in French.

Since the APSO extension deserves to get a far better visibility, it is now also made available for download here on AskLibreOffice ( Scroll down for the link... ). For this purpose i tried to translate the original introduction text from Hubert Lambert into English: ( please forgive any errors in the translation that might have occurred, and correct where necessary.. )

______________ Start of translation

Managing Scripts in Python by Hubert Lambert » 09 Nov 2016 17:49

Good day to all,

[To follow up on [this thread](https://forum.openoffice.org/fr/forum/viewtopic.php?f=8&t=52689), and in particular the suggestion by Dude, i post here a part of the original message.]

Hanya, one of the most brilliant and effective contributors of the sections "Macros and API" on the English-language forum, has in 2012 proposed a script ( Alternative Python Script Organizer ) that enormously simplifies the management of Python scripts on OpenOffice or LibreOffice. I think this script deserves a far better visibilty.

To make it easier to use, i have adapted it as follows :

 - French translation of the commands and menu-items ;
- Added two commands "Embed in document" and "Export" from an existing document ( the code is but a variation of the original code by Hanya ) ;
- ( Very elementary ) implementation of the option "Edit" through which the script can be modified by the default system editor ;
- Packaging into an extension to facilitate the installation.


Once this extension is installed ( and the program is restarted just to make sure ), a new menu-item "Organise python scripts..." will appear in the submenu "Macros" of the menu "Tools".

This new menu-item opens a dialog box listing the scripts and proposing various actions :

[APSO_dialogue.png]

The button "Execute" allows you to launch the selected macro.

The available actions from the button "Menu" vary according to the selection, and they are :

 - Create a library or a module if the selection is a container ( "user", "share" or "document" ) ;
- Edit*, rename, delete a module or a library ;
- Copy a module from the application ( "user" or "share" ) to the current document ;
- Replace a module that is embedded in a document by a module that is located on the computer ;
- Export a module that is embedded in a document.
[* The option "Edit" only opens the module with the text-editor associated by default to the extension ".py". It doesn't work for scripts that are embedded inside a document.]


This version 0.2, compatible with OpenOffice and LibreOffice, also includes the following elements :

 - internationalization of the extension ( currently French and English ) ;
- Added a default keyboard shortcut ( Shift + Alt + F11 ) for quick launch ;
- a mini-library to facilitate development, which contains three functions: xray, mri and msgbox.


To access these from a script, you must have at least once launched the python scripts organizer ( to load the path ) and insert the following line:

from apso_utils import xray, mri, msgbox


( and Of course installed Xray or MRI if necessary ).

For any suggestion, question or remark, the initial thread given above seems to me the most suitable place.

Added: version 0.3 :
- addition of German and Italian ;
- correction of the code.

- addition of Hungarian ( thanks to Zizi64 ).

- added an options page that allows you to choose the editor ( based on Hanya's EditorKicker ) ;
- Opening macros on the corresponding line, if the appropriate option is set ;
- adapted the vocabulary to be consistent with the default macro manager ( following this thread ) ;
- better management of errors and accented dialogs.

- taken into account the property allowMacroExecution for embedded macros ;
- subject to providing the editing parameters, possibility of directly accessing the syntax errors from the error message;
- direct editing of embedded macros ( only in the context of the extension ).

- fixed a bug ;

- Fixes a problem ( under Windows ) when a path or document contains non-ascii characters.


______________ End of translation

A big "Thank You!" to the author, co-authors, developers, and contributors who made the APSO extension come true!

On this date ( May 21st 2017 ), the current version of the APSO extension is 0.8.3.

( just unzip the .ott file to get the .oxt file ... since .oxt is not among the permitted file types to upload )

apso_v0.8.3.oxt.ott

( a newer version might become available on the French site ...)

### Did you know that you could also easily use APSO to Organize your Python scripts from within LibreOffice using APSO?LibreOffice?

In 2012, the original code for the "Alternative Python Script Organizer" ( APSO ) was written by Hanya. Some adjustments to the code were made at that time by @Karolus. In 2016, Hubert Lambert adapted the original script and made it into an .oxt extension. The APSO extension is available on the French OpenOffice Forum, with an introduction text in French.

Since EDIT 2017-06-19 11:27 As of today the APSO extension deserves to get a far better visibility, it is now can also made available be downloaded from the LibreOffice Extensions repository: APSO - Alternative Script Organizer for download here on AskLibreOffice ( Scroll down for the link... Python ( Thanks Jean-Marc Zambon and @Ratslinger ). For this purpose END OF EDIT 2017-06-19 11:27

i tried to translate the original introduction text from Hubert Lambert into English: ( please forgive any errors in the translation that might have occurred, and correct where necessary.. )

______________ Start of translation

Managing Scripts in Python by Hubert Lambert » 09 Nov 2016 17:49

Good day to all,

[To follow up on [this thread](https://forum.openoffice.org/fr/forum/viewtopic.php?f=8&t=52689), and in particular the suggestion by Dude, i post here a part of the original message.]

Hanya, one of the most brilliant and effective contributors of the sections "Macros and API" on the English-language forum, has in 2012 proposed a script ( Alternative Python Script Organizer ) that enormously simplifies the management of Python scripts on OpenOffice or LibreOffice. I think this script deserves a far better visibilty.

To make it easier to use, i have adapted it as follows :

 - French translation of the commands and menu-items ;
- Added two commands "Embed in document" and "Export" from an existing document ( the code is but a variation of the original code by Hanya ) ;
- ( Very elementary ) implementation of the option "Edit" through which the script can be modified by the default system editor ;
- Packaging into an extension to facilitate the installation.


Once this extension is installed ( and the program is restarted just to make sure ), a new menu-item "Organise python scripts..." will appear in the submenu "Macros" of the menu "Tools".

This new menu-item opens a dialog box listing the scripts and proposing various actions :

[APSO_dialogue.png]

The button "Execute" allows you to launch the selected macro.

The available actions from the button "Menu" vary according to the selection, and they are :

 - Create a library or a module if the selection is a container ( "user", "share" or "document" ) ;
- Edit*, rename, delete a module or a library ;
- Copy a module from the application ( "user" or "share" ) to the current document ;
- Replace a module that is embedded in a document by a module that is located on the computer ;
- Export a module that is embedded in a document.
[* The option "Edit" only opens the module with the text-editor associated by default to the extension ".py". It doesn't work for scripts that are embedded inside a document.]


This version 0.2, compatible with OpenOffice and LibreOffice, also includes the following elements :

 - internationalization of the extension ( currently French and English ) ;
- Added a default keyboard shortcut ( Shift + Alt + F11 ) for quick launch ;
- a mini-library to facilitate development, which contains three functions: xray, mri and msgbox.


To access these from a script, you must have at least once launched the python scripts organizer ( to load the path ) and insert the following line:

from apso_utils import xray, mri, msgbox


( and Of course installed Xray or MRI if necessary ).

For any suggestion, question or remark, the initial thread given above seems to me the most suitable place.

Added: version 0.3 :
- addition of German and Italian ;
- correction of the code.

- addition of Hungarian ( thanks to Zizi64 ).

- added an options page that allows you to choose the editor ( based on Hanya's EditorKicker ) ;
- Opening macros on the corresponding line, if the appropriate option is set ;
- adapted the vocabulary to be consistent with the default macro manager ( following this thread ) ;
- better management of errors and accented dialogs.

- taken into account the property allowMacroExecution for embedded macros ;
- subject to providing the editing parameters, possibility of directly accessing the syntax errors from the error message;
- direct editing of embedded macros ( only in the context of the extension ).

- fixed a bug ;

- Fixes a problem ( under Windows ) when a path or document contains non-ascii characters.


______________ End of translation

A big "Thank You!" to the author, co-authors, developers, and contributors who made the APSO extension come true!

On this date ( May 21st June 19th 2017 ), the current version of the LibreOffice APSO extension is 0.8.3.1.0.0.

( just unzip the .ott file to get the .oxt file ... since .oxt is not among the permitted file types to upload )

( a newer version might become available on the French site ...)

### Did you know that you could also use APSO to Organize your Python scripts within LibreOffice?

In 2012, the original code for the "Alternative Python Script Organizer" ( APSO ) was written by Hanya. Some adjustments to the code were made at that time by @Karolus. In 2016, Hubert Lambert adapted the original script and made it into an .oxt extension. The APSO extension is available on the French OpenOffice Forum, with an introduction text in French.

EDIT 2017-06-19 11:27 As of today the APSO extension can also be downloaded from the LibreOffice Extensions repository: APSO - Alternative Script Organizer for Python ( Thanks Jean-Marc Zambon and @Ratslinger ). END OF EDIT 2017-06-19 11:27

i tried to translate the original introduction text from Hubert Lambert into English: ( please forgive any errors in the translation that might have occurred, and correct where necessary.. )

______________ Start of translation

Managing Scripts in Python by Hubert Lambert » 09 Nov 2016 17:49

Good day to all,

[To follow up on [this thread](https://forum.openoffice.org/fr/forum/viewtopic.php?f=8&t=52689), and in particular the suggestion by Dude, i post here a part of the original message.]

Hanya, one of the most brilliant and effective contributors of the sections "Macros and API" on the English-language forum, has in 2012 proposed a script ( Alternative Python Script Organizer ) that enormously simplifies the management of Python scripts on OpenOffice or LibreOffice. I think this script deserves a far better visibilty.

To make it easier to use, i have adapted it as follows :

 - French translation of the commands and menu-items ;
- Added two commands "Embed in document" and "Export" from an existing document ( the code is but a variation of the original code by Hanya ) ;
- ( Very elementary ) implementation of the option "Edit" through which the script can be modified by the default system editor ;
- Packaging into an extension to facilitate the installation.


Once this extension is installed ( and the program is restarted just to make sure ), a new menu-item "Organise "Organize python scripts..." will appear in the submenu "Macros" of the menu "Tools".

This new menu-item opens a dialog box listing the scripts and proposing various actions :

[APSO_dialogue.png]

The button "Execute" allows you to launch the selected macro.

The available actions from the button "Menu" vary according to the selection, and they are :

 - Create a library or a module if the selection is a container ( "user", "share" or "document" ) ;
- Edit*, rename, delete a module or a library ;
- Copy a module from the application ( "user" or "share" ) to the current document ;
- Replace a module that is embedded in a document by a module that is located on the computer ;
- Export a module that is embedded in a document.
[* The option "Edit" only opens the module with the text-editor associated by default to the extension ".py". It doesn't work for scripts that are embedded inside a document.]


This version 0.2, compatible with OpenOffice and LibreOffice, also includes the following elements :

 - internationalization of the extension ( currently French and English ) ;
- Added a default keyboard shortcut ( Shift + Alt + F11 ) for quick launch ;
- a mini-library to facilitate development, which contains three functions: xray, mri and msgbox.


To access these from a script, you must have at least once launched the python scripts organizer ( to load the path ) and insert the following line:

from apso_utils import xray, mri, msgbox


( and Of course installed Xray or MRI if necessary ).

For any suggestion, question or remark, the initial thread given above seems to me the most suitable place.

Added: version 0.3 :
- addition of German and Italian ;
- correction of the code.

- addition of Hungarian ( thanks to Zizi64 ).

- added an options page that allows you to choose the editor ( based on Hanya's EditorKicker ) ;
- Opening macros on the corresponding line, if the appropriate option is set ;
- adapted the vocabulary to be consistent with the default macro manager ( following this thread ) ;
- better management of errors and accented dialogs.

- taken into account the property allowMacroExecution for embedded macros ;
- subject to providing the editing parameters, possibility of directly accessing the syntax errors from the error message;
- direct editing of embedded macros ( only in the context of the extension ).