When using Skim with sublime text / LaTeX it fires the following command, yielding an error message
$ /Applications/Skim.app/Contents/SharedSupport/displayline -r -g 40 /path/to/file.pdf /path/to/file.tex 236:254: syntax error: Internal table overflow. (-2707)
As far as I am aware this is new in 1.6.6. This makes using it with ST impossible. I think this only crashes on one of my two devices --- the one running Monterey.
It is just a script. So this looks to me more like a bug in sublime text. Note that the script has not changed, and neither has the support inside Skim.
Moreover, I see no problem running displayline from the (ordinary) command line.
And really, the AppleScript is absolutely not big, it is really small in fact. So that really cannot give a problem, un less you have a really bad AppleScript runner. Also, the line numbers (or whatever they mean) at the beginning of the message make no sense to me.
The problem for me occured too when running from the command line so it is not ST specific except if the command is malformed somehow. Reinstalling skim did not help. It was the only open PDF file.
It worked perfectly fine on my iMac on big sur on the exact same files. On my Monterey MacBook it crashes for every file I have tried so far.
I manually compiled Skim on the MacBook a few days ago to try the dark mode (it still worked then), but I switched to the release version before the bug happened. As far as I am aware the manual compilation worked every time and the release version crashes every time. Could this be related?
Do you perhaps have a really large amount of PDF documents open? There's really nothing else where the script even accesses multiple objects.
Reverse engineering a bit: simply running the AppleScript
causes the internal table overflow. Console.app shows an automator related fault at that time:
I have 0 experience with AppleScript/Automator so I don't know what to do. Online searches also brought up nothing for me.
I am on the Monterey developer beta so I am afraid this might be related.
Last edit: Hans Schülein 2021-11-22
It must be the Monterey beta. We really don't do anything wrong (as you can see from the fact that it always worked before), and the script absolutely is not too large. Perhaps you can file a bug report with Apple on Monterey's AppleScript support, it can only be them.
I don't hope Apple has finally completely broken AppleScript support. I did hear stories that they are completely screwing up internally in the Automator department for a while now. I am not sure if they even have an active team anymore, having fired the lead developer.
I put a test version of Skim at https://skim-app.sourceforge.io/Skim.zip. Could either of you try this out and see whether it allows acting on by AppleScript, possible through displayline? Not too much change, but it is the only thing I can think of.
That URL 404s. I cannot download the file, but I will happily try it out :)
I see what happened, it added the final period to the URL. Here it is again:
https://skim-app.sourceforge.io/skim.zip
And this time you accidentally lower cased it ^^
It still does not work, same error. Interestingly before the first launch it crashed with
because I hadn't confirmed the "unknown developer" prompt yet. So the error has to happen after that point in the pipeline.
Yes, it did not go though Apple's security theater.
I replaced it with another more aggressive test version, indeed at
https://skim-app.sourceforge.io/Skim.zip
(I thought URLs were supposed to be case insensitive?)
URLs usually are case insensitive but sometimes you want to for example base64 encode sth in parameters and then you can use them as non-case sensitive. Apparently sourceforge decided on case sensitivity here. Maybe because they want to differentiate the same file in svn with and without capitalization.
Automator now yields
and a terminal run yields
(the last error was -2707)
Sorry. I made another try...
Good news! Automator now runs
without the table-error
running the full command on the commandline however now yields a new and exciting error:
That can make sense, I removed just a bit too much for displayline to run.
Anyway, I now have an idea where Monterey's bug lies. Apple apparently does not allow extensive scriptability anymore! It is really annoying they did this, and I hope they will fix this (soon).
Was this already a problem in 12.0, or is this new in the 12.1 beta?
I think it was still working fine a week ago, so according to that reasoning it must have been the latest beta. But I don't have a device on that beta anymore so I cannot confirm it.
Is there a way to fix this that does not require action on Apple's side, or will applescript capability just be broken in 12.1+ forever?
I wil happily test another version for you.
Just to be clear, it was working for you earlier on 12.0.1? And now it fails for you on 12.1 beta 3? And that is where you tried the test version that allowed automation?
As for the fix, I really think it should be fixed by Apple. But they often are very slow to act, or even acknowledge this kind of bugs. On the other hand, if it worked on 12.0, I don't see why they could not easily reverse the bug they introduced in 12.1, perhaps even before their release.
The problem seems to be that they reduced the size of the memory they use to store the scripting definition of the apps, or somewhere else something wastes a lot of extra memory. We could fix this by scrapping part of the scripting support. But I would have no idea how much we need to scrap.
And I replaced the test version with one that tries to do this more than before. Could you please test it?
i think it was working fine in the last beta but not in this one.
the new version is back to a table overflow
And the last beta was a 12.1 beta, or a 12.0.x beta?
I have yet again replaced the test version with an even smaller sdef. Beginning to touch the more relevant stuff...
I am not sure what version I was on before, sorry. The new version still yields the table overflow.
Somehow I am not getting any email notifications for this thread anymore. Does SF stop doing that after a certain depth?
I am having some other issues with the current developer beta of macOS, maybe the next one magically fixes everything
Have you ever tried downloading the previous release to see if that works on the 12.1 beta?
Not too much chance, as the changes are very minor and really should not stop scripting.
Last edit: Christiaan Hofman 2021-12-02