On 17/01/2026 23:20, David F. wrote:
Thanks, Knute.  I am aware of those, but they don’t quite get me what I want.  If I hardcode the output directory with \bookOutputName, then it can’t be overridden from the command line.

I'm not sure if this covers exactly your use case but should be easily adaptable if not. Check the input and output file names. If they match the -o option has not been used, in which case bookOutputName is called to change the output file name.

\version "2.24.0"

#(let* ((opfile (ly:parser-output-name))
        (ipfile (basename (ly:parser-lookup 'input-file-name) ".ly")))
  (when (string=? ipfile opfile)
    #{ \bookOutputName "newname" #}))

{
  c'1
}

--
Timothy Lanfear, Bristol, UK.

Reply via email to