On Jan 15, 2011, at 16:03, Moritz Angermann wrote:

> Hi Christiaan,
> 
> Sorry, you are right, I've missed that wiki page. I'm still confused why the 
> revert menu item is
> grayed out, even though the revert command can be issued from AppleScript.
> 
> kindest regards,
> Moritz Angermann
> 

The revert menu item does not do exactly the same as the AppleScript revert 
command. The latter will always work. The menu item is basically implemented by 
the system (though we override it when we detect a change on disk). Even if we 
would enable it, it would do nothing in this case.

I can't tell you precisely why it is disabled, as I don't know what your 
commands do to the file(s). What I can imagine is that it first moves the old 
file, then replaces it with the new, and finally deletes the old file. In that 
case, Cocoa will (partially) track the (moved) old file, which is now deleted, 
which explains why the Revert menu item is disabled. There is no way we can 
track the file in such cases, as we're partly dependent on the black box that 
is Cocoa.

As has been said many times, and indicated on the Wiki, the auto-reload 
functionality does not and cannot work for any situation. The preferred way to 
reload is to do so from outside Skim using a script that combines the tex and 
reload actions, as you've done. Skim cannot in general know when tex is 
finished, it can only make educated guesses.

Christiaan

> On Jan 15, 2011, at 3:46 PM, Christiaan Hofman wrote:
> 
>> The Wiki has a discussion of this, including sample scripts. Also compare 
>> the displayline script.
>> 
>> Christiaan
>> 
>> On Jan 15, 2011, at 14:21, Moritz Angermann wrote:
>> 
>>> Hi,
>>> 
>>> I've just completely wiped out Skim and installed a fresh copy. I'm having 
>>> a weird issue:
>>> 
>>> I used to use Skim with TeX and auto-refresh. If something during pdflatex 
>>> screwed up I
>>> used to just revert the file. So far so good.
>>> 
>>> A few weeks ago I started to give pandoc a try as a Markdown preprocessor 
>>> for LaTeX.
>>> Currently I use the xetex engine from pandoc to compile the markdown file 
>>> to tex and from 
>>> there to pdf. 
>>> 
>>> Skim seems not to pick up the change in the .pdf file and thus does not 
>>> auto refresh. But 
>>> it even has the "revert" menu item grayed out. No matter if I have the 
>>> "Check for file changes"
>>> option in the Sync settings enabled or not. I have to quit Skim and reopen 
>>> it. There seems no
>>> /simple/ way around right now.
>>> 
>>> Using AppleScript I was able to create some replacement using a script 
>>> provided on the web[1]
>>> as basis:
>>> 
>>> === skim ===
>>> #!/bin/bash
>>> pdf_home=$(dirname $(./getlink $0))
>>> exec osascript \
>>> -e "tell application \"Skim\"" \
>>> -e "activate" \
>>> -e "open ((POSIX file \"$pdf_home/$*\") as string)" \
>>> -e "revert front document" \
>>> -e "end tell";
>>> 
>>> 
>>> which needs the following helper script I found on SO [2]:
>>> 
>>> === getlink ===
>>> #!/bin/sh
>>> 
>>> TARGET_FILE=$1
>>> 
>>> cd `dirname $TARGET_FILE`
>>> TARGET_FILE=`basename $TARGET_FILE`
>>> 
>>> # Iterate down a (possible) chain of symlinks
>>> while [ -L "$TARGET_FILE" ]
>>> do
>>>  TARGET_FILE=`readlink $TARGET_FILE`
>>>  cd `dirname $TARGET_FILE`
>>>  TARGET_FILE=`basename $TARGET_FILE`
>>> done
>>> 
>>> # Compute the canonicalized name by finding the physical path 
>>> # for the directory we're in and appending the target file.
>>> PHYS_DIR=`pwd -P`
>>> RESULT=$PHYS_DIR/$TARGET_FILE
>>> echo $RESULT
>>> 
>>> 
>>> To glue it all together I currently use a Makefile that call's pandoc and 
>>> skim in succession.
>>> 
>>> kindest regards,
>>> Moritz Angermann
>>> 
>>> 
>>> [1] 
>>> http://phaseportrait.blogspot.com/2007/07/script-to-open-file-in-skim-from.html
>>> [2] 
>>> http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
>>> 


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Skim-app-users mailing list
Skim-app-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to