lilypond-user
[Top][All Lists]
Advanced

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

Re: Interactive PDF Link to Notes in Preview


From: Federico Bruni
Subject: Re: Interactive PDF Link to Notes in Preview
Date: Thu, 02 Aug 2018 09:28:06 +0200



Il giorno lun 9 lug 2018 alle 7:26, Mats Behre <"mb.maillists"@gmail.com> ha scritto:
On 2018-07-08 19:56, Federico Bruni wrote:

I found this: https://superuser.com/questions/548119/how-do-i-configure-custom-url-handlers-on-os-x and downloaded SwiftDefaultApps. It works on High Sierra, don't know about El Capitan, but if not it seems that RCDefaultApp should do the trick for you.

Can you be more specific?
What do you mean with "it works"?
Which command did you assign for textedit protocol?

Yesterday I read a similar answer and installed RVDefaultApp. Now I can set which application should open textedit:// URIs. However I cannot set the text editor directly, as the text editor cannot handle this protocol.

I guess I should use lilypond-invoke-editor but, as I've already reported, I could not make it work on either Mac or Windows.

It looks like it's the last step to get what I want.


OK, then you are in more or less the same situation as me - you need a small helper app that takes the URI and invokes your editor. I have a small AppleScript app which does this (I think I got the base for it from the LilyPond site ages ago):

You may simply use the same bash script that works in Linux:

$ ls -l /usr/local/bin/lilypond-invoke-editor
lrwxrwxrwx 1 root root 37 1 ago 16.06 /usr/local/bin/lilypond-invoke-editor -> /usr/local/bin/lilypond-wrapper.guile

$ cat /usr/local/bin/lilypond-wrapper.guile
#!/bin/sh
export PYTHONPATH="/usr/local/lilypond/usr/lib/lilypond/current/python:/usr/local/lilypond/usr/share/lilypond/current/python:$PYTHONPATH"
export GUILE_LOAD_PATH="/usr/local/lilypond/usr/share/lilypond/current"
export LD_LIBRARY_PATH="/usr/local/lilypond/usr/lib:$LD_LIBRARY_PATH"
me=`basename $0`
exec "/usr/local/lilypond/usr/bin/guile" "/usr/local/lilypond/usr/bin/$me" "$@"

I adapted it above file to the correct path in Mac and I can now launch:

lilypond-invoke-editor textedit://path/to/file.ly:1:2:3

Last step left is how to tell the system to use lilypond-invoke-editor to open textedit URIs. I've created a new app containing the bash script to launch lilypond-invoke-editor, but I cannot find a way to associate it to the textedit URIs. See below.



My problem now is that SwiftDefaultApps silently fails to set this as the textedit target, possibly because my info.plist is too old (it has worked in the past):


I got a silent fail also with RCDefaultApp.
Today I installed SwiftDefaultApps, but when I try to open it, it says it doesn't work with Intel processors.

I tried a simplified version of below Info.plist (I copied, as you did, the relevant part from LilyPond Info.plist). Unfortunately I could not find an easy tutorial to write your own Info.plist from scratch. It seems that normal procedure is building it in Xcode...


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
        <key>CFBundleAllowMixedLocalizations</key>
        <true/>
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
        <key>CFBundleExecutable</key>
        <string>applet</string>
        <key>CFBundleIconFile</key>
        <string>applet</string>
        <key>CFBundleIdentifier</key>
        
<string>com.apple.ScriptEditor.id.1A1CE0AF-AC45-4636-9B72-8CBBFCDA88F5</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>lilypoint</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleSignature</key>
        <string>aplt</string>
        <key>CFBundleURLTypes</key>
        <array>
                <dict>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                        <key>CFBundleURLName</key>
                        <string>text editor via url</string>
                        <key>CFBundleURLSchemes</key>
                        <array>
                                <string>textedit</string>
                        </array>
                </dict>
        </array>
        <key>LSMinimumSystemVersionByArchitecture</key>
        <dict>
                <key>x86_64</key>
                <string>10.6</string>
        </dict>
        <key>LSRequiresCarbon</key>
        <true/>
        <key>WindowState</key>
        <dict>
                <key>bundleDividerCollapsed</key>
                <true/>
                <key>bundlePositionOfDivider</key>
                <real>0.0</real>
                <key>dividerCollapsed</key>
                <false/>
                <key>eventLogLevel</key>
                <integer>2</integer>
                <key>name</key>
                <string>ScriptWindowState</string>
                <key>positionOfDivider</key>
                <real>680</real>
                <key>savedFrame</key>
                <string>1238 373 1015 944 0 0 2560 1417 </string>
                <key>selectedTab</key>
                <string>log</string>
        </dict>
</dict>
</plist>

I have not yet had time to find out what the problem is - you may be luckier.

/mb




reply via email to

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