[Libreoffice-bugs] [Bug 133585] Sound to verify document has been saved

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Jun 5 08:11:56 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=133585

--- Comment #13 from Heiko Tietze <heiko.tietze at documentfoundation.org> ---
(In reply to neil from comment #11)
> Can you tell me if I could build a macro to do this.

With pleasure. Took this as example
https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=57699#

Sub Main
  oSounMgr = CreateUnoService("com.sun.star.comp.media.Manager_GStreamer")
  If NOT IsNull(oSounMgr) Then
    oSfa = CreateUnoService("com.sun.star.ucb.SimpleFileAccess")
    sBaseURL = CreateUnoService("com.sun.star.util.PathSubstitution")._
        substituteVariables("$(inst)/share/gallery/sounds", True)

    sSound1 = sBaseURL & "/ok.wav"
    If oSfa.exists(sSound1) Then
      oPlayer1 = oSounMgr.createPlayer(sSound1)
      oPlayer1.setPlaybackLoop(False)
      oPlayer1.start()
      while oPlayer1.isplaying()
        doevents
      wend 
    End If
  End If
End Sub

Use Tools > Customize > Events to bind save to this macro.

(In reply to neil from comment #11)
> Know anywhere I could look online?

We have some guides for macros [1], some more information [2], and formed a
help team recently [3]. And questions like this are also well suited for
ask.libreoffice.org. 

[1] https://documentation.libreoffice.org/en/english-documentation/macro/
[2] https://wiki.documentfoundation.org/Macros
[3]
https://blog.documentfoundation.org/blog/2020/04/08/libreoffice-macro-team-progress-report-2/

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200605/1a57987c/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list