]> git.lyx.org Git - lyx.git/blobdiff - development/MacOSX/lyxeditor
Move handling of LFUN_COPY to BufferView
[lyx.git] / development / MacOSX / lyxeditor
index 553acb0953fe9f1dcd87b2ea0b10a0eb25520d03..9d6aabe0629a51292bbffe2ad135fb0638eee747 100755 (executable)
@@ -59,12 +59,18 @@ do
        if [ -n "$LYXPIPE" -a -p "$LYXPIPE".in ]; then
                break
        fi
+       # now check for default pipe location
+       if [ -p "${ABS_USER_LYXDIR}"/.lyxpipe.in ]; then
+               LYXPIPE="${ABS_USER_LYXDIR}/.lyxpipe"
+               break
+       fi
 done
 
 # echo "preferences file sets lyxpipe as ${LYXPIPE}"
 
 test -z "${LYXPIPE}" && {
-       ABS_SYSTEM_LYXDIR='/Applications/LyX.app/Contents/Resources'
+       ABS_SYSTEM_LYXDIR=$(dirname "$0")
+       ABS_SYSTEM_LYXDIR=$(dirname "${ABS_SYSTEM_LYXDIR}")"/Resources"
        test -d "${ABS_SYSTEM_LYXDIR}" || {
                echo "Failed to find ABS_SYSTEM_LYXDIR: ${ABS_SYSTEM_LYXDIR}" >&2
                exit 1
@@ -81,12 +87,13 @@ test -z "${LYXPIPE}" && {
 }
 
 if [ -n "$LYXPIPE" -a -p "$LYXPIPE".in ]; then
-       file=$(echo "$1" | sed 's|^/private||')
-
-       MAC_LYXPIPE_CONTENTS="LYXCMD:macdvix:server-goto-file-row:$file $2"
+       MAC_LYXPIPE_CONTENTS="LYXCMD:macdvix:server-goto-file-row:$1 $2"
        # echo "$MAC_LYXPIPE_CONTENTS"
        echo "$MAC_LYXPIPE_CONTENTS" > "${LYXPIPE}".in || { echo "Cannot write to lyxpipe." ; exit 2 ; }
-       read < "${LYXPIPE}".out || { echo "Cannot read from lyxpipe." ; exit 2 ; }
+       while read line ; do
+               echo LyX said: $line
+       done < "${LYXPIPE}".out || { echo "Cannot read from lyxpipe." ; exit 2 ; }
+       test -x /usr/bin/osascript && /usr/bin/osascript -e 'tell application id "org.lyx.lyx" to activate'
 else
        echo "Our best guess sets lyxpipe as ${LYXPIPE}"
        echo "But the lyxpipe could not be found."