[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: 53
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 7089 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 7.4.7.2 on Debian 12
JeJe
Volunteer
Posts: 3064
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: 1226
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 7011 times
AOO4, Libreoffice 6.1 on Rasbian OS (on ARM)
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 24.8… flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
User avatar
Jurassic Pork
Posts: 28
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 6940 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