Revision: 7069
http://skim-app.svn.sourceforge.net/skim-app/?rev=7069&view=rev
Author: hofman
Date: 2011-01-11 15:30:32 +0000 (Tue, 11 Jan 2011)
Log Message:
-----------
set some options in displayline script directly in applescript text
Modified Paths:
--------------
trunk/displayline
Modified: trunk/displayline
===================================================================
--- trunk/displayline 2011-01-11 11:47:43 UTC (rev 7068)
+++ trunk/displayline 2011-01-11 15:30:32 UTC (rev 7069)
@@ -14,16 +14,16 @@
fi
# get arguments
-revert=0
-bar=0
-activate=1
+revert=false
+bar=false
+activate=true
while [ "${1:0:1}" == "-" ]; do
if [ "$1" == "-r" -o "$1" == "-revert" ]; then
- revert=1;
+ revert=true
elif [ "$1" == "-b" -o "$1" == "-readingbar" ]; then
- bar=1
+ bar=true
elif [ "$1" == "-g" -o "$1" == "-background" ]; then
- activate=0
+ activate=false
fi
shift
done
@@ -35,28 +35,24 @@
[ "${file:0:1}" == "/" ] || file="${PWD}/${file}"
[ "${source:0:1}" == "/" ] || source="${PWD}/${source}"
-# pass arguments as NULL-separated string to osascript
+# pass file arguments as NULL-separated string to osascript
# pass through cat to get them as raw bytes to preserve non-ASCII characters
-echo -ne
"${line}\x00${file}\x00${source}\x00${revert}\x00${bar}\x00${activate}\x00" | \
+echo -ne "${file}\x00${source}" | \
/usr/bin/osascript \
-e "set theArgv to do shell script \"/bin/cat\"" \
-e "set AppleScript's text item delimiters to ASCII character 0" \
- -e "set {theLine, theFile, theSource, shouldRevert, shouldShowBar,
shouldActivate} to text items of theArgv" \
- -e "set theLine to theLine as integer" \
+ -e "set {theFile, theSource} to text items of theArgv" \
-e "set theFile to POSIX file theFile" \
-e "set theSource to POSIX file theSource" \
- -e "set shouldRevert to (shouldRevert as integer) as boolean" \
- -e "set shouldShowBar to (shouldShowBar as integer) as boolean" \
- -e "set shouldActivate to (shouldActivate as integer) as boolean" \
-e "set thePath to POSIX path of (theFile as alias)" \
-e "tell application \"Skim\"" \
- -e " if shouldActivate then activate" \
- -e " if shouldRevert then" \
+ -e " if $activate then activate" \
+ -e " if $revert then" \
-e " try" \
-e " set theDocs to get documents whose path is thePath" \
-e " if (count of theDocs) > 0 then revert theDocs" \
-e " end try" \
-e " end if" \
-e " open theFile" \
- -e " tell front document to go to TeX line theLine from theSource showing
reading bar shouldShowBar" \
+ -e " tell front document to go to TeX line $line from theSource showing
reading bar $bar" \
-e "end tell" -
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web. Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit