[Solved] Send message to screen from python script

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Locked
luofeiyu
Posts: 55
Joined: Thu Sep 14, 2017 2:11 am

[Solved] Send message to screen from python script

Post by luofeiyu »

Edit python script to print string into the screen:

Code: Select all

vim  .config/libreoffice/4/user/Scripts/python/test.py
def output_screen():
    print("call python in macro")
Call the function in macro:
output.png
output.png (27.41 KiB) Viewed 8340 times
Nothing happen when to click the "run" button!
Last edited by MrProgrammer on Sat Mar 08, 2025 6:16 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] Mutliple solutions provided
LibreOffice 24.8 on Debian 12
JeJe
Volunteer
Posts: 3109
Joined: Wed Mar 09, 2016 2:40 pm

Re: How can output message into the screen when to call python script in macro?

Post by JeJe »

Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
karolus
Volunteer
Posts: 1234
Joined: Sat Jul 02, 2011 9:47 am

Re: How can output message into the screen when to call python script in macro?

Post by karolus »

terminal_output.png
terminal_output.png (59.74 KiB) Viewed 8262 times
Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (Bookworm) (on RaspberryPI5)
User avatar
Jurassic Pork
Posts: 31
Joined: Wed Oct 25, 2017 7:55 am
Location: France

Re: How can output message into the screen when to call python script in macro?

Post by Jurassic Pork »

Hello,
with APSO extension, for python macros , you have a Debug Window and a Console Window to see the print :
APSO_Print.gif
APSO_Print.gif (85.71 KiB) Viewed 8191 times
Friendly, J.P
OpenOffice 4.1.14 , LibreOffice 7.6.2.1 on Windows 11/ LibreOffice 7.3.7 on Lubuntu 22.04
Locked