On Mar 3, 2011, at 4:15 PM, Christiaan Hofman wrote:

> Try running some applescript in AppleScript Editor, and see what commands 
> fail. It seems it's an AppleScript problem, and AppleScript is extremely 
> fragile and it's behavior (i.e. its many bugs) change for every OS version. 
> Have a look in the displayline script 
> (Skim.app/Contents/SharedSupport/displayline) to see what AppleScript it 
> uses. In particular the "go to" command. Try something like:
> 
> tell application "Skim"
>       tell document 1
>               go to line 1000
>       end tell
> end tell
> 
> 
> and:
> 
> 
> set theFile to POSIX file "/path/to/your/file.pdf"
> tell application "Skim"
>       activate
>       open theFile
>       tell document 1
>               go to line 1000
>       end tell
> end tell
> 
> 
> and:
> 
> 
> set theFile to POSIX file "/path/to/your/file.pdf"
> set theSource to POSIX file "/path/to/your/file.tex"
> tell application "Skim"
>       activate
>       open theFile
>       tell document 1
>               go to line 1000 from theSource
>       end tell
> end tell

Dear Christiaan,

I've done a few tests with AppleScript, with mixed (and quite baffling) 
results. The first script you mention in your message works flawlessly 
(replacing "go to line 1000" by "go to TeX line 1000", but that was just a typo 
in your email, I think). However, the second and third ones fail miserably. 
More precisely, the file is opened if it wasn't already, but its corresponding 
window stays on the first page, or (if the file was already open) its window is 
selected, but stays wherever it was. Moreover, the script never completes (it 
just says "Running" in the results log) unless stopped by hand (and it takes 
quite a while to stop, actually). In fact, from the event log one can see that 
the only events processed are (if the file in question is 
/Users/Shared/myfile.pdf)

tell application "Skim"
        activate
        open file "Mac OS X Lion:Users:Shared:myfile.pdf"

(By the way, I tried the same thing withe files whose path didn't contain 
spaces, like "/Volumes/TRANS-IT/foo.pdf", and the behavior was the same). So it 
seems to me the problem is either with the open command or with the filename 
format Skim is expecting, but (since no errors are reported in the system log) 
I have no idea of what the heck is going on. Any suggestions?

Thanks again,

Artemio

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to