Description: When loading a Keynote presentation in headless mode it's not possible to access it with internal PyUno script. Keynote in non-headless mode works fine. ODP in headless mode works fine. Steps to Reproduce: 1. create test.py internal python script with a function that get the current component and print it to the console. Script location under Ubuntu: /usr/lib/libreoffice/share/Scripts/python/test.py test.py script content: def test(): desktop = XSCRIPTCONTEXT.getDesktop() cmp = desktop.getCurrentComponent() print(cmp) 2. Execute the script with a Keynote presentation: libreoffice --headless 'vnd.sun.star.script:test.py$test?language=Python&location=share' test.key 3. None is printed to the console instead of the component object. 4. Test without headless mode: libreoffice 'vnd.sun.star.script:test.py$test?language=Python&location=share' test.key 5. Verify the component object is printed to the console. 6. Execute the script with ODP presentation: libreoffice --headless 'vnd.sun.star.script:test.py$test?language=Python&location=share' test.odp 7. Verify the component object is printed to the console. Actual Results: None is printed to the console. We can't access the Current Component. Expected Results: We should be able to access the Current Component and print it to the console. Reproducible: Always User Profile Reset: No Additional Info: Version: 6.3.2.2 Build ID: 1:6.3.2-0ubuntu0.18.04.1~lo1 CPU threads: 1; OS: Linux 5.0; UI render: default; VCL: gtk3; Locale: en-US (en_IL); UI-Language: en-US Calc: threaded
Created attachment 155469 [details] Keynote presentation
Created attachment 155470 [details] Impress presentation
Created attachment 155486 [details] test python script i cannot confirm this with: Version: 6.3.3.2 (x64) Build-ID: a64200df03143b798afd1ec74a12ab50359878ed CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win; Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE Calc: soffice d:/test.key "vnd.sun.star.script:test.py$test?language=Python& location=share" and soffice d:/test.odp "vnd.sun.star.script:test.py$test?language=Python&location=share" will always print cmp, but with parameter "--headless" both will always print "None"
If both files print "None" with --headless parameter, that's a bug. Headless mode shouldn't break access to the presentation component. Can you change the status to confirmed?
(In reply to Pablo from comment #4) > If both files print "None" with --headless parameter, that's a bug. Headless > mode shouldn't break access to the presentation component. Can you change > the status to confirmed? i am not sure if this is a bug: "provides read access to the component inside the tree which has the UI focus" https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1frame_1_1XDesktop.html#a50a9f0bc6e533b4616d9aee0176a1116
I'm not sure. I'll use this to get the Component instead: cmp = desktop.getComponents().createEnumeration().nextElement() Feel free to close this issue if you think it works as intended.
(In reply to Pablo from comment #6) > I'm not sure. I'll use this to get the Component instead: > cmp = desktop.getComponents().createEnumeration().nextElement() > Feel free to close this issue if you think it works as intended. You could always ask in https://ask.libreoffice.org/ for advice. Let's close for now.