title: Path of current document in [Libre|Open]Office
body: <p>How can I determine the path of the currently open document in an OpenOffice or LibreOffice document? I want to forward the path to an external application. </p>
  
  <p>More specifically I want to launch an external player from impress with a video file in full-screen mode:</p>
  
  <pre><code>Shell("/usr/bin/mplayer", 2, """ -fs"" some-file-in-same-dir-as-document.mp4")
  </code></pre>
  
  <p>For the last parameter I would need the path to the currently opened document in order to append it. Not specifying the path results in referring to the current path (as given by the <code>CurDir()</code> function) which is something different. </p>
  
  <p>Is there actually a good reference for LibreOffice Macros? The only relatively good (but hard to search) document I have found is "<a href="http://www.pitonyak.org/book/" rel="nofollow">OpenOffice Macros Explained</a>" by Andrew Pitonyak. </p>