[Solved] Loop through slides and set Transitions

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Migs351
Posts: 2
Joined: Tue Jan 17, 2017 4:39 pm

[Solved] Loop through slides and set Transitions

Post by Migs351 »

I'm working on a Kiosk enabled RPi.

I'm trying to use the following method:

https://www.youtube.com/watch?v=HzBzC...

Using the macros found here:

https://bz.apache.org/ooo/show_bug.cg...

This should be sufficient to set the settings to do things to make the Kiosk loop through a presentation. But it's not working as I had hoped.

If there's no Transition between slides, it doesn't advance, regardless of Presentation.IsAutomatic(True). I am looking for a way to macro in looping through all slides and setting the transition for every slide as it opens the document, before it starts the presentation.

Also would be a nice thing to remove all Animations from all slides as well. To eliminate that possibility of pretty much all show stopping problems.

Are there methods that I can tap into that will allow me to set Transitions and remove animations on each slide?

Using LibreOffice on RPi, which yes, I know is different, but the BASIC should be fairly similar. :ucrazy:

Any help would be appreciated.
Last edited by Migs351 on Tue Jan 17, 2017 7:38 pm, edited 2 times in total.
LibreOffice 4.3.3.2 on Raspbian 8 (Jessie)
Migs351
Posts: 2
Joined: Tue Jan 17, 2017 4:39 pm

Re: Loop through slides and set Transitions

Post by Migs351 »

Actually I just figured this out on my own, as least for the Transitions part. Here's my code for the loop:

Code: Select all

Dim Doc as object
Dim CurSlide as object

Doc = ThisComponent

For i = 0 to Doc.getDrawPages().Count-1
  CurSlide = Doc.getDrawPages().getByIndex(i)
  Doc.CurrentController.setCurrentPage(CurSlide)
  CurSlide.Change = 1 // 0 = Click to Proceed, 1 = Automatic, 2 = Play objects automatically, but still need click? 
  CurSlide.Duration = 15  // Time in seconds
Next i

// Return to first Slide before starting
CurSlide = Doc.getDrawPages().getByIndex(0)
Doc.CurrentController.setCurrentPage(CurSlide)
Now all I need to do is add into that same loop a second loop to cycle through each object and remove the animation. Shouldn't be difficult knowing I can access the properties this way now.
LibreOffice 4.3.3.2 on Raspbian 8 (Jessie)
ThiemoCh
Posts: 1
Joined: Thu Nov 09, 2017 5:08 pm

Re: [Solved] Loop through slides and set Transitions

Post by ThiemoCh »

If I do as you described in your script, my presentation Loops exactly one time through all slides, but halts at the end and does not jump back to slide one to start again.
Even with a 2nd Loop.
Somehow .setCurrentPage(CurSlide) seems not to work the way intended in the end of your script.
I'm lost, I tried a lot of different Things already, but non seems to help me start looping the presentation from start again.
Any Idea, Any Help?

Cheers,

Thiemo.
Libre Office 5.4 Raspian Jessie
Post Reply