lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lilypond working on Mac OS X 10.5, thanks


From: Christopher Suckling
Subject: Re: Lilypond working on Mac OS X 10.5, thanks
Date: Thu, 3 Jul 2008 23:26:55 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Wed, Jul 02, 2008 at 08:02:32PM +0000, Carl Sorensen wrote:

> Christopher Suckling <suckling.list <at> googlemail.com> writes:
> 
> This looks really interesting, but I'm enough of a newbie to MacOS that
> it's hard for me to follow it all.
> 
> > 
> > Sorry it's a brief write up - I'm a bit rushed now. If you want more
> > details (tomorrow at earliest), let me know.
> 
> Please do!
> 

Best thing to do is to go through from scratch, then you can alter to
suit your own textediting preferences.

1) Delete any old PPC LilyPond binaries

2) Download and install Platypus: 

http://www.sveinbjorn.org/platypus

(Please refer to it's documentation as necessary for the following
steps)

3) Create a new application wrapping the following Applescript:


property urlPrefix : "textedit://"

on open location texteditURL
        
        -- strip prefix 
        set the character_count to the number of characters of the urlPrefix
        set the emacsclientURL to (characters (the character_count + 1) thru -1 
of the texteditURL) as string
        
        -- extract PATH LINE and COLUMN
        set AppleScript's text item delimiters to ":"
        set emacsclientPATH to first text item of emacsclientURL
        set emacsclientLINE to second text item of emacsclientURL
        set emacsclientCOLUMN to last text item of emacsclientURL
        set AppleScript's text item delimiters to ""
        
        -- launch emacsclient
        do shell script "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient 
--no-wait +" & emacsclientLINE & ":" & emacsclientCOLUMN & " " & emacsclientPATH
end open location


This obviously opens LilyPond's hyperlinks in Emacs. To launch other
editors, you will want to change the "do shell script" line; although
I called the variables emacsclientFOO, they are not reliant on
Emacs. They merely separate out the file, line and column numbers from
LilyPond's textedit URL.


4) Having saved your new application, right-click on it and select
   "Show Package Contents".

Open Contents/Info.plist in your favourite text editor.

Add the following lines under the CFBundleSignature string:


        <key>CFBundleURLTypes</key>
        <array>
                <dict>
                        <key>CFBundleURLName</key>
                        <string>retrieve textedit urls generated by 
lilypond</string>
                        <key>CFBundleURLSchemes</key>
                        <array>
                                <string>textedit</string>
                        </array>
                </dict>
        </array>

Save Info.plist and you should be good to go...

5) QuickLook LilyPond files. 

Two choices: you could add the following to your previously created
script wrapper; I prefer to use a separate wrapper as I have a few
different file types that aren't supported by default; rather than
alter the Info.plist of every application that is associated with
these file, I store them all in the following wrapper:

6) Create another Platypus wrapper, this time without any script.

7) As before, edit it's Info.plist

Add the following lines somewhere within the top-level dictionary:

        <key>UTExportedTypeDeclarations</key>
        <array>         
                <dict>
                        <key>UTTypeConformsTo</key>
                        <array>
                                <string>public.source-code</string>
                        </array>
                        <key>UTTypeDescription</key>
                        <string>LilyPond Source File</string>
                        <key>UTTypeIdentifier</key>
                        <string>org.lilypond.lilypond</string>
                        <key>UTTypeTagSpecification</key>
                        <dict>
                                <key>public.filename-extension</key>
                                <array>
                                        <string>ly</string>
                                        <string>lily</string>
                                        <string>ily</string>
                                </array>
                        </dict>
                </dict>
        </array>
   
8) You may have to logout/login for this to take effect

9) Coloured syntax for LilyPond QuickLook:

Download and install QLColorCode

http://code.google.com/p/qlcolorcode/

10) Download Highlight source package (not the OS X package)

http://www.andre-simon.de/index.html

11) From Highlight, extract the following files:

langDefs/ly.lang

12) Copy the ly.lang file to (don't forget to right-click to see the
package contents)

QLColorCode.qlgenerator/Contents/Resources/override/langDefs/

13) Edit
QLColorCode.qlgenerator/Contents/Resources/override/config/filetypes.conf 

Add

        $ext(lilypond)=ly lily ily      

to the list.

And you should be good to go.

Haven't got a Spotlight importer working yet, but otherwise it's a
pretty complete OS X LilyPond environment...

Hope this is of some use,

Christopher


 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]