Revision: 12591
http://sourceforge.net/p/skim-app/code/12591
Author: hofman
Date: 2021-12-01 10:54:34 +0000 (Wed, 01 Dec 2021)
Log Message:
-----------
Set revert variable to AppleScript code to revert rather than true/false flag
Modified Paths:
--------------
trunk/displayline
Modified: trunk/displayline
===================================================================
--- trunk/displayline 2021-11-30 23:33:56 UTC (rev 12590)
+++ trunk/displayline 2021-12-01 10:54:34 UTC (rev 12591)
@@ -15,19 +15,24 @@
fi
# get arguments
-revert="false"
+revert=""
showing_bar=""
activate="activate"
zerobased=
+from_source=""
while [[ "${1:0:1}" == "-" ]]; do
if [[ "$1" == "-r" || "$1" == "-revert" ]]; then
- revert="true"
+ revert=" try
+ set thePath to POSIX path of (theFile as alias)
+ set theDocs to get documents whose path is thePath
+ if (count of theDocs) > 0 then revert theDocs
+ end try"
elif [[ "$1" == "-b" || "$1" == "-readingbar" ]]; then
showing_bar="with showing reading bar"
elif [[ "$1" == "-g" || "$1" == "-background" ]]; then
activate=""
elif [[ "$1" == "-z" || "$1" == "-zerobased" ]]; then
- zerobased="1"
+ zerobased=1
fi
shift
done
@@ -40,7 +45,7 @@
[[ "${file:0:1}" == "/" ]] || file="${PWD}/${file}"
[[ "${src}" == "" || "${src:0:1}" == "/" ]] || src="${PWD}/${src}"
-[[ "${src}" == "" ]] && from_source="" || from_source="from POSIX file
\"$src\""
+[[ "${src}" == "" ]] || from_source="from POSIX file \"$src\""
[[ -z ${zerobased} ]] || (( line+=1 ))
@@ -48,15 +53,9 @@
/usr/bin/osascript << EOF
set theFile to POSIX file "$file"
tell application "Skim"
- if $revert then
- try
- set thePath to POSIX path of (theFile as alias)
- set theDocs to get documents whose path is thePath
- if (count of theDocs) > 0 then revert theDocs
- end try
- end if
+ $revert
open theFile
- tell front document to go to TeX line $line $from_source $showing_bar
+ go document 1 to TeX line $line $from_source $showing_bar
$activate
end tell
EOF
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit