[Solved] Random Sorting of Slides

Discuss the presentation application

[Solved] Random Sorting of Slides

Postby LaurieFlood » Fri Apr 16, 2010 9:12 am

I am using Impress as Spanish flash cards. I am wondering how I can get Impress to randomly sort the slides. Actually, any kind of a sort is okay, even alphabetically. I did try Open Cards, but it is too slow and unresponsive with the number of slides I have (700). I just want the cards in any other order than I created them. The slide sorter seems slow and unwieldy with such a large file, if it works as it appears - drag and drop.

Also, can one put the presentation on an iPod?

Thanks in advance,
Last edited by Hagar Delest on Sat Apr 17, 2010 6:16 pm, edited 1 time in total.
Reason: Tagged as solved
Laurie Flood
OpenOffice 3.2 on Windows Vista
LaurieFlood
 
Posts: 9
Joined: Fri Apr 16, 2010 9:03 am

Re: Random Sorting of Slides

Postby RoryOF » Fri Apr 16, 2010 9:19 am

I think the immediate answer to both of your questions is that it is not readily possible. The Slide Sorter is really a Slide Rearranger, to allow the presenter to order his slides differently; as far as I know it does not apply any ordering algorithm other than his drag and drop.

It may be possible to export your presentation as a series of slides and import them to an iPod; you may have to invent how to do this!
Apache OpenOffice 4.1.6 on Xubuntu 18.04 (mostly 64 bit version) and infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 27874
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Random Sorting of Slides

Postby acknak » Fri Apr 16, 2010 5:03 pm

You may want to have a look at this extension: http://extensions.services.openoffice.o ... /OpenCards

If you want to do something manually, you can set up a custom slide order, which you can "randomize". Not the same as displaying the slides in a random order, but maybe useful nonetheless.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Random Sorting of Slides

Postby LaurieFlood » Fri Apr 16, 2010 10:40 pm

Thanks for your replies, RoryOF and Acknak!

I will try to export the slides as a series and see if iPod will play them.

Acknak,

I have tried Open Cards, but it works too slowly and crashes too frequently with this many cards (slides). When you say I can set up a custom slide order, will I have to drag and drop in the slide sorter to do that? That looks way too cumbersome with such a big file. Is there any other way to set up a custom slide order?

Thanks again to both of you!

I have used the OO Writer for quite a few years now. I am really impressed with it and very grateful. Impress is also a fine product. I am just stretching it to its limits here, but it is the best way to learn a foreign language, along with comprehensible and engaging little stories. When you are not in a total immersion environment, that is! Combining the Barron's Spanish books and Spanishpod101 with the Impress flash cards really makes it stick!
Laurie Flood
OpenOffice 3.2 on Windows Vista
LaurieFlood
 
Posts: 9
Joined: Fri Apr 16, 2010 9:03 am

Re: Random Sorting of Slides

Postby acknak » Sat Apr 17, 2010 12:51 am

When you say I can set up a custom slide order, will I have to drag and drop in the slide sorter to do that That looks way too cumbersome with such a big file. Is there any other way to set up a custom slide order?

Yes, That seems to be the only way to do it.

If you're handy with a text editor, you could edit the xml source directly; the custom show amounts to a simple list of slide names:
    <presentation:show
    presentation:name="New Custom Slide Show"
    presentation:pages="page1,page3,page5,page7,page10,page12,page15"
    />
but that doesn't seem very practical either.

You might want to ask in one of the macro areas here, if it's a simple matter, someone might be willing to help you cobble together a little macro to create a custom show with the slides in random order.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Random Sorting of Slides

Postby LaurieFlood » Sat Apr 17, 2010 2:01 am

Thanks again, Acknak!

This idea sounds easier. I think that you are saying that the custom slide show creates its own file. I can go in that file and just organize the numbers in a more random fashion. That beats the dragging and dropping. It does make sense that I could create some kind of random number generating line of code to create the generator within the XML. It's been a long time since I learned Pascal, C, and XML for classes, but I never put them to use, since I became a teacher. I'll have to give that one some thought...

Thanks for the great idea! This is still a work in progress, but it seems a bit easier now.
Laurie Flood
OpenOffice 3.2 on Windows Vista
LaurieFlood
 
Posts: 9
Joined: Fri Apr 16, 2010 9:03 am

Re: Random Sorting of Slides

Postby acknak » Sat Apr 17, 2010 2:41 am

I think that you are saying that the custom slide show creates its own file.

Not quite.

If you wanted to try that, you'd have to dig into the document file: unpack the document's xml content, edit that, and then update the document file with the modified version. Not hard, but also not for the faint of heart.

I think the macro is probably the way to go.

Hmm... one other possibility: you can export all the slides as images and then use an image viewer to display the images in random order. As long as you don't need any animations, that would work fine and be fairly easy to set up.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Random Sorting of Slides

Postby LaurieFlood » Sat Apr 17, 2010 6:33 am

Thanks again, Acknak!

I did find out that Lightroom will present slides randomly, but I am unable to get Impress to export the presentation as individual jpegs. When I tried to export to jpeg, it only exported the first slide, not the entire presentation in individual jpegs. How would I do that? I could not find the info in the documentation for the program.

Thanks again!
Laurie Flood
OpenOffice 3.2 on Windows Vista
LaurieFlood
 
Posts: 9
Joined: Fri Apr 16, 2010 9:03 am

Re: Random Sorting of Slides

Postby acknak » Sat Apr 17, 2010 6:43 am

Sorry, it's not obvious how to do it.

If you use File > Export, as type: "HTML Document", then OOo will create a set of files suitable for viewing in a web browser. Among the files is a set of images, one per slide, along with some html files to organize and incorporate the image files. You just keep the images and throw the rest away. An image viewer should just ignore the other files.

Just be careful to create a new folder to contain just the exported files: Impress will create 3-4 files per slide, and if that big pile of files ends up mixed in with your other documents and files, it can be a real pain to sort out.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Random Sorting of Slides

Postby FJCC » Sat Apr 17, 2010 7:10 am

I wrote this macro that modifies a pre-existing custom presentation to have the slides in random order. When you create the custom presentation, it doesn't have to have all of your slides in it, just one will do. I named the custom presentation FirstCust and coded that into the macro. If you want to use a different name, you'll have to change the line of code
Code: Select all   Expand viewCollapse view
MyCust = CustPres.getByName("FirstCust")

to have whatever name you choose. I tested it on a 128 slide presentation and it seemed to run instantaneously. I bet the run time will be noticeable for 700 slides, but I hope it won't be too long. Every time you run the macro you will get a new order for the slides.


Code: Select all   Expand viewCollapse view
Sub SlideShuffle
oDoc = ThisComponent
DPages = oDoc.getDrawPages
Count = DPages.Count
DIM List(Count-1) as Integer
DIM RndList(Count-1) as Integer
DIM TmpList(Count-1) as Integer
For i = 0 to Count-1
   List(i) = i
next i
For x = Count-1 to 0 Step -1
Redim TmpList(x)
RndNum = INT(Rnd*(x+1))
RndList(Count-1-x) = List(RndNum)
If x > 0 then
   
   If RndNum > 0 then
      For i = 0 to RndNum - 1
         TmpList(i) = List(i)
      next i
   end if
   If RndNum < x then
      For i = RndNum + 1 to x
         TmpList(i-1) = List(i)
      next i
   end if
   Redim List(x-1)
   List() = TmpList()
end if
next x

CustPres = oDoc.getCustomPresentations()
MyCust = CustPres.getByName("FirstCust")
SlideCount = MyCust.Count
If SlideCount > 0 then
For x = 0 to SlideCount -1
   MyCust.removeByIndex(0)
next x
end if
For x = 0 to Count-1
   RndSlide = DPages.getByIndex(RndList(x))
   MyCust.insertByIndex(x, RndSlide)
next x


End Sub
AOO 3.4 or 4.1 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 6932
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Random Sorting of Slides

Postby LaurieFlood » Sat Apr 17, 2010 7:21 am

Thanks, FJCC!

I imagine I save the macro in Writer and then place it where Impress can find it. Where would that be?

Thanks everyone! This is going to really help my studying!
Laurie Flood
OpenOffice 3.2 on Windows Vista
LaurieFlood
 
Posts: 9
Joined: Fri Apr 16, 2010 9:03 am

Re: Random Sorting of Slides

Postby FJCC » Sat Apr 17, 2010 6:28 pm

There are a couple of places you could save the macro, but in this case I think it is best to save it within the document itself, so you can run it regardless of which computer you are on.
Open the Impress presentation and press ALT+F11. This will open a window titled OpenOffice.org Basic Macros. On the left will be a tree list with categories of My Macros, OpenOffice.org Macros and one for each document you have open.
Click on the + sign next to your Impress presentation. This will highlight the document
Click on the New button on the right. A little dialog will appear titled New Module and with Module1 as the suggested name. Click OK.
This will bring up the window titled YourDocumentName.Standard - OpenOffice.org Basic into which you will save the macro.
In the window you will see text similar to
Code: Select all   Expand viewCollapse view
REM ****** BASIC  *****
Sub Main

End Sub


Delete the Sub Main and the End Sub
Copy the entire text of the macro from my post, including the Sub SlideShuffle and the End Sub.
Paste the macro into the window you opened through the above instructions.
Select File -> Save from the window.
Close the window and you should be back to the original presentation
To run the macro, press ALT+F11 and click on the + next to the file name. You will see a folder called Standard. Click on the + next to that and then select Module 1. On the right you will see SlideShuffle. If it is not highlighted, click on it, then select Run.
AOO 3.4 or 4.1 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 6932
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: [Solved] Random Sorting of Slides

Postby LaurieFlood » Sat Apr 17, 2010 11:13 pm

Thanks FJCC!

Muchas gracias. Es muy amable!

Thanks ever so much! The macro works great! It works very quickly, even with such a big file! The Open Cards was so choked by the large file, that I could only study about 50 cards in a half an hour. With such a big list - that will likely be 1500 cards before I am through - it was much too slow. This works as quickly and responsively as if I had a 30 card presentation.

The only thing I would add to your directions for others who might need it, would be to remind them to set up a custom slideshow with one card and remember to click the box to use the custom presentation.

Thanks to FJCC and everyone that responded. I love OO and the OO community of users! You are all wonderful!
Laurie Flood
OpenOffice 3.2 on Windows Vista
LaurieFlood
 
Posts: 9
Joined: Fri Apr 16, 2010 9:03 am

Re: [Solved] Random Sorting of Slides

Postby bunny-ears » Tue May 18, 2010 10:58 am

I realize this is a solved problem, but there's some oooBasic code, similar to that which appears above. The main difference is, instead of requiring a pre-existing custom slideshow, it creates and saves a new one. http://www.oooforum.org/forum/viewtopic.phtml?t=92222
OpenOffice 3.2 on Ubuntu 10.04
bunny-ears
 
Posts: 1
Joined: Tue May 18, 2010 10:50 am

Re: [Solved] Random Sorting of Slides

Postby LaurieFlood » Tue May 18, 2010 11:03 am

Thanks, Bunny-ears. I'll try that one, too. The one with the custom slide show is working great!
Laurie Flood
OpenOffice 3.2 on Windows Vista
LaurieFlood
 
Posts: 9
Joined: Fri Apr 16, 2010 9:03 am

Re: [Solved] Random Sorting of Slides

Postby JJ Henry » Mon Jan 14, 2019 7:23 pm

Gorgeous!

It's worked very well.

Now one more question... could you suggest me a way to show the first slide with a button on it, which can shuffle the next slides, assigning it the (modified, somehow) macro you wrote?
Thanx everybody out there
JJ Henry
OpenOffice 2.4 on Ubuntu 18.04
JJ Henry
 
Posts: 1
Joined: Mon Jan 14, 2019 7:11 pm


Return to Impress

Who is online

Users browsing this forum: No registered users and 1 guest