TypeIt4Me problem with AppleScript snippets
June 13, 2008 at 12:54 AM by Dr. Drang
Two weeks ago, I posted the following bug report to the the TypeIt4Me technical support forum:
I am having a problem with TypeIt4Me’s AppleScript clipping feature on my iBook G4. I have a clipping with the following AppleScript: tell application “Safari” to get URL of front document When I run this clipping from within the text editor TextMate, it comes out looking like thisThe “spaces” before each character are not really spaces, they’re unprintable characters. I’ve saved this in a file called tm-g4.txt and run the xxd utility on it to see what the characters are. Here are the results:
h t t p : / / m y . y a h o o . c o m /The unprintables are nulls. At first I thought this was some weird interaction between TypeIt4Me and TextMate, but… When I run the same clipping from within TextEdit, the spaces don’t appear, but saving it to a file called te-g4.txt and running xxd on it gives me the same thing:
% xxd tm-g4.txt 0000000: 0068 0074 0074 0070 003a 002f 002f 006d .h.t.t.p.:././.m 0000010: 0079 002e 0079 0061 0068 006f 006f 002e .y...y.a.h.o.o.. 0000020: 0063 006f 006d 002f .c.o.m./So the nulls are there, but TextEdit just isn’t showing them. I don’t get this behavior with the same clipping on my Intel iMac. On this machine, there are no blanks before the characters when the clipping is inserted in a TextMate document. Saving the document to a file called tm-intel.txt and running xxd on it yields
% xxd te-g4.txt 0000000: 0068 0074 0074 0070 003a 002f 002f 006d .h.t.t.p.:././.m 0000010: 0079 002e 0079 0061 0068 006f 006f 002e .y...y.a.h.o.o.. 0000020: 0063 006f 006d 002f .c.o.m./No nulls, which is how it should be. I got the same result from using the clipping in TextEdit on the Intel iMac:
% xxd tm-intel.txt 0000000: 6874 7470 3a2f 2f6d 792e 7961 686f 6f2e http://my.yahoo. 0000010: 636f 6d2f com/Running the wc utility on these files also shows that the G4 versions have two bytes for every byte in the Intel versions:
% xxd te-intel.txt 0000000: 6874 7470 3a2f 2f6d 792e 7961 686f 6f2e http://my.yahoo. 0000010: 636f 6d2f com/Is this some sort of big-endian/little-endian thing? Can it be fixed?
% wc tm-g4.txt 0 1 40 tm-g4.txt % wc tm-intel.txt 0 1 20 tm-intel.txt % wc te-g4.txt 0 1 40 te-g4.txt % wc tm-intel.txt 0 1 20 tm-intel.txt
The problem arose when I tried to use the snippets I discussed in this post on my iBook G4. I really like the idea of having programmable snippets available system-wide, not just in TextMate. But I can’t use the feature if it keeps spitting out these spurious nulls.
So far, there’s been no response from Ettore Software, which is a bit annoying. I’m pretty sure the forum is where Ettore wants bugs reported.
While waiting for a response, I downloaded the trial version of TextExpander to see if it has the same problem. It doesn’t; AppleScript snippets in TextExpander expand perfectly on both my Intel and G4 machines.
Were it not for the AppleScript snippet bug, I’d prefer to use TypeIt4Me, because it has the AutoCue feature that allows me to enter variable text at placeholder locations within the snippet—similar to the tab stops in TextMate’s snippets. With the bug, however, the scale tips to TextExpander. If I don’t get some encouraging response from Ettore, I’ll have to go ahead and buy it when the trial period is over.