On Jan 10, 2008, at 9:36 AM, Paul McCann wrote:
Hi again,
Does this perhaps match your experience? I.e. if for instance you have a folder Desktop/testing, and in it a file ab.tex, and then another folder Desktop/testing2 and a file ab.tex there, do you still see the problem? Yep, completely unchanged. (There were no spaces in my original test cases, but I checked "parallel" directories with no spaces in the complete paths just to be sure.)
Please pardon any repetition, but maybe it can help us get to the bottom of this: it looks to me like the root of the problem I'm seeing is in the "check_open" command, the output of which doesn't seem to depend on the location of the pdf file, but only its name. That is, consider the following sequence...
[the file "fred.pdf" from "~/Desktop/testing" is open in TeXShop; it's the only thing open in TeXShop]
% cd Desktop/testing % /Applications/TextMate.app/Contents/SharedSupport/Bundles/ Latex.tmbundle/Support/bin/check_open TeXShop fred.pdf %
[That is, it correctly reports that the file is open. Now just change dir and see if it thinks the other pdf file is open too...]
% cd ../testing2 % /Applications/TextMate.app/Contents/SharedSupport/Bundles/ Latex.tmbundle/Support/bin/check_open TeXShop fred.pdf %
[Here's where I think the problem lies: check_open is again reporting that "fred.pdf" is open, but I'm betting that the command above should be referring to the "fred.pdf" in "testing2", not that from "testing".]
In the command "runViewer" this causes control to pass to the refreshViewer command instead of invoking the "open -a ........." command that's required.
Does this make any sense?
Yes, I am suspecting the same thing, but this doesn't explain why it works in my computer and not yours. check_open seems to have the same behaviour in my computer as you describe, yet things seem to work out. In fact, as far as I can tell, check_open will report the file as open regardless of which directory you currently are in, even if no such pdf file exists in the directory. I'm guessing it uses applescript to ask Skim about a file with that name, though I don't know for sure.
What I don't understand though is why pdfFile is not the full path to the file to begin with, and why check_open does not work with full pathnames. Since Brad is the mastermind behind this part of the bundle, I hope he'll find some time to chime in. It does look as though that part of the process might be somewhat fragile, anything involving Applescript is. Actually, I cannot even tell if check_open is applescript or not. Brad?
Cheers, Paul
Haris Skiadas Department of Mathematics and Computer Science Hanover College