Showing posts with label bugfixes. Show all posts
Showing posts with label bugfixes. Show all posts

Thursday, September 04, 2008

iTerm AppleScript crashing fix

Lately, my officemate and I noticed that iTerm build 0.9.5.0902 crashes whenever AppleScript tries to talk to it. I was excited about some of the full screen fixes, but I couldn't do without my "Open iTerm Here" context menu item, and so I had to come up with a fix.

In my old scripts, I was doing things like this:
tell application "iTerm"
activate
set theTerm to make new terminal
tell theTerm
set theSession to make new session at the end of sessions
tell theSession to
exec command "/bin/bash -login"
write text "ls"
end tell
end tell
end tell
It appears like it's the make new session that's causing the problem. So I changed the set theSession... and tell theSession... lines to use a launch instead. The result:
tell application "iTerm"
activate
set theTerm to make new terminal
tell theTerm
launch session "Default Session"
tell the last session
exec command "/bin/bash -login"
write text "ls"
end tell
end tell
end tell
Not only does that not crash for me anymore, but it seems to be a bit faster (my imagination?).

Thursday, July 12, 2007

Skim automatic refreshes and simpdftex

UPDATE: I've updated the script so that it works with OS/X Leopard. See comments for details.
The OS X PDF viewer Skim has the ability to automatically refresh files after they have been updated on disk. In Skim version 0.4.1 and below, this was done by polling a file every second to see if it has been changed. In Skim version 0.5 and up, this feature is implemented using kqueue events. This is a much better way of doing things. However, if the file that is open gets deleted and a new file created with the same name, events for that new file will not be received by Skim.

Unfortunately, the script simpdftex that comes with a number of LaTeX distributions (e.g., gwTeX) deletes a PDF before updating it. This means that autorefreshes won't work when regenerating a PDF from its LaTeX source using simpdftex.

So, motivated by the history in a Skim bug report, I've put together a simpdftexnodel script that fixes this problem (based on the 2007/05/07 gwTeX simpdftex). To use this file:
  • Place the script somewhere (probably in your PATH).
  • chmod the file 0755.
  • Make sure that your distillers and TeX program (or at least symlinks to them) exist in the same directory.
  • Stop using simpdftex and start using simpdftexnodel.
I hope that helps!

Monday, May 28, 2007

powerdot clock fix

UPDATE: Soon after the posting of this, Hendri posted this patch (by Heiko Oberdiek) which is nothing but a more compact refactoring of the code below.

As of May 2007, the clock feature of the powerdot presentation class for LaTeX has not been working. I think that I have a good patch. I have sent this patch to Hendri Adriaens, powerdot's author of record, who has added verification of it to his todo list.

First, update to the latest versions of hyperref, oberdiek, and xcolor. These packages have been updated very recently, and so you must not take for granted that you have the latest versions.

Next, if you have the
[2005/12/06 v1.3 powerdot presentation class (HA,CE)]
version of powerdot, you can simply replace your powerdot.cls file with this one, which is linked here for easy viewing.

Alternatively (this may work with newer versions of powerdot too), patch your version of powerdot with this patch which is shown below.
--- powerdot.orig/powerdot.cls 2007-05-28 00:38:50.000000000 -0400
+++ powerdot/powerdot.cls 2007-05-28 10:24:52.000000000 -0400
@@ -65,7 +65,7 @@
\AtBeginDocument{%
\@Form[]%
\ifnum\pd@orient=\z@
- \def\pd@clockrot{] /R 90\@gobble}%
+ \def\pd@clockrot{90}%
\else
\let\pd@clockrot\@empty
\fi
@@ -579,7 +579,8 @@
\edef\pd@tempa{\expandafter\pd@tempa\pd@tempb\@nil}%
\ifx\pd@@clockpos\@empty\else
\rput[\pd@@clockhook](\pd@@clockpos){%
- \TextField[name=pdclock.time,bordercolor=\pd@clockrot,%
+ \TextField[name=pdclock.time,%
+ bordercolor=,rotation=\pd@clockrot,%
backgroundcolor={},align=\pd@@clockalign,color=\pd@tempa,%
charsize=\pd@@clockcharsize,width=\pd@@clockwidth,%
height=\pd@@clockheight]{}%
If you use this patch method, invoking
patch -p1 < powerdot-clockfix.patch
in the directory that holds powerdot.cls should be sufficient, assuming that the patch file is also in that directory.