Re: invoking Lilypond from a script

2005-04-25 Thread Kris Shaffer
Thanks for the input, guys.  The dirname and basename were exactly
what I needed, working with cd in the shell.  I had some trouble
getting AppleScript to interface properly with Bash in executing
these, so I reverted to perl (where I'm much more comfortable) to do
the actual work.  (I'm sure there's a way to get AppleScript to do it,
but I knew how to do it in perl, and the AppleScript documentation
I've found is terrible--though it's easy to make a simple graphical
app)  So the end result:  A droplet in the Finder which uses
AppleScript to call perl to call the shell to call Lilypond!  But it
works!  The result is a very simple app.  If you want to take a look,
it is at www.shaffermusic.com/apps.html.  Thanks again for your help.

Kris Shaffer

On 4/8/05, Erik Sandberg [EMAIL PROTECTED] wrote:
 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



___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: invoking Lilypond from a script

2005-04-09 Thread Arjan Bos
Just to rule out things, I take it you looked at the convert - DVI to 
Postscript.scpt that comes with the folder actions (or a similar one)?

My guess is that you need to use the --output=FILE option of Lilypond. 
This option is in 2.4.2. I haven't checked with 2.2.5 due to lack of 
availability on my system. It is something which I tried myself, but 
could not  get working after trying for roughly 10 minutes. It might 
need some POSIX keyword on your path. Otherwise you could just tell 
finder to move the document, couldn't you?

HTH
On 8 apr 2005, at 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.
Sincerely,
Kris Shaffer
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

---
A marriage is always made up of two people who are prepared to swear 
that only the other one snores.

-- (Terry Pratchett, The Fifth Elephant)
---
It was funny how people were people everywhere you went, even if the 
people concerned weren't the people the people who made up the phrase 
people are people everywhere had traditionally thought of as people. 
And even if you weren't virtuous, as you had been brought up to 
understand the term, you did like to see virtue in other people, 
provided it didn't cost you anything.

-- (Terry Pratchett, The Fifth Elephant)

___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


invoking Lilypond from a script

2005-04-08 Thread Kris Shaffer
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.

Sincerely,
Kris Shaffer


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: invoking Lilypond from a script

2005-04-08 Thread David Rogers
Kris Shaffer wrote:

...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. 


Can you make the shell script cd to the directory the file is in, first?

David


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: invoking Lilypond from a script

2005-04-08 Thread Erik Sandberg
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


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user