On Feb 20, 2012, at 11:10 AM, [email protected] 
wrote:

> On Feb 19, 2012, at 23:04, Artemio Gonz?lez L?pez wrote:
> 
>> After a little bit of experimenting, I think I've narrowed down the problem 
>> down significantly. More specifically, I've now checked that the following 
>> DO WORK:
>> 
>> 1)  Running an ApplesScript script like the following directly from Script 
>> Editor:
>> 
>> set theFile to POSIX file "/Users/artemio/Desktop/Apuntes/MC.pdf"
>> set theSource to POSIX file "/Users/artemio/Desktop/Apuntes/chap2.tex"
>> tell application "Skim"
>>      activate
>>      open theFile
>>      tell front document to go to TeX line 100 from theSource
>> end tell
>> 
>> 2) Running the following equivalent shell script from the Terminal:
>> 
>> /usr/bin/osascript \
>>  -e 'set theFile to POSIX file "/Users/artemio/Desktop/Apuntes/MC.pdf"' \
>>  -e 'set theSource to POSIX file "/Users/artemio/Desktop/Apuntes/chap2.tex"' 
>> \
>>  -e 'tell application "Skim"' \
>>  -e 'activate' \
>>  -e 'open theFile' \
>>  -e 'tell front document to go to TeX line 1000 from theSource' \
>>  -e 'end tell'
>> 
>> 
>> Therefore, it seems to me that displayline fails when the arguments are 
>> passed to bin/echo as null-separated strings. Indeed, the error after 
>> running a command like " .../displayline line 100 foo.pdf foo.tex" at the 
>> Terminal is
>> 
>> 102:160: execution error: Can?t get item 1 of {}. (-1728)
>> 
>> which seems to indicate that theArgv is empty. Is there any reasonable way 
>> to fix this?
>> 
>> Thanks in advance,
>> 
>> Artemio
>> 
>> 
>> Artemio Gonz?lez L?pez
>> [email protected]
> 
> What if you copy the displayline script and replace the last part as follows:
> 
> /usr/bin/osascript \
>  -e "set theLine to ${line} as integer" \
>  -e "set theFile to POSIX file \"${file}\"" \
>  -e "set theSource to POSIX file \"${source}\"" \
>  -e "set thePath to POSIX path of (theFile as alias)" \
>  -e "tell application \"Skim\"" \
>  -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 $bar" \
>  -e "end tell" -
> 
> and then use the copy?
> 
> Christiaan

Now it works fine!

Thanks a lot,

Artemio


Artemio Gonzalez Lopez
[email protected]



------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to