[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: invoking Lilypond from a script
From: |
Erik Sandberg |
Subject: |
Re: invoking Lilypond from a script |
Date: |
Sat, 9 Apr 2005 00:55:44 +0200 |
User-agent: |
KMail/1.7.2 |
On Friday 08 April 2005 19.29, Kris Shaffer wrote:
> Thanks for making such a great product. I love using Lilypond. I am
> currently working on an applescript app for Mac OS X that will allow a
> .ly file to be dragged to a Lilypond icon to create the PDF score
> without using the command line. My hopes is that it will help make
> Lilypond more accesible to traditional Mac users. However, when I
> call Lilypond (v. 2.2.5) from the appescript (i.e. do shell script
> "/sw/bin/lilypond [filename.ly]"), it outputs the score to / instead
> of the directory the source file is in. I'm wondering if there is a
> reason why it would not automatically export to the originating
> folder, as it does when I invoke it in the terminal. Perhaps the
> Applescript calling the shell script is the problem? Let me know if
> you know of a reason this may be behaving unexpectedly, or if you need
> more information from me. Otherwise, I will add some extra code and
> variables to get around the issue. Thanks.
lilypond writes files to the current working directory. If you are in a
console, and you cd to e.g. /tmp/foo, and write
lilypond /bar/blah/x.ly
then the output will be located in /tmp/foo/. This is simply the convention
most Unix-style software use.
You could either run lilypond with a different working directory, or you could
specify the output by passing -o to lilypond. You may be interested in
looking at the commands dirname and basename.
Erik