Of white space, line ending, and GREP in BBEdit

This is completely "inside baseball" and likely of little interest, unless you happen to use BBEdit and LaTeX and want to search and replace using GREP. As a side benefit, it gives me a break from actually working on my tenure file!

The basic problem is finding white spaces and then replace them with LaTeX column separators (&), without having BBEdit include the line endings. An example text is:

2015    Spring  4770    1   3.9 4.5 4.4
2015    Spring  2110    3   4.4 4.5 4.4
2015    Fall    4760    1   4.3 4.3 4.3
2015    Fall    2110    2   4.4 4.3 4.3
2016    Winter  3100    3   4.4 4.5 4.4
2016    Winter  3100    2   4.0 4.5 4.4
2016    Spring  2110    2   4.5 4.4 4.4
2016    Spring  2110    3   4.8 4.4 4.4

I could, of course, just use the column copy and paste in BBEdit, but where is the fun in that!

My first inclination was to use

\s*

but that captures the line endings as well, so I turned to my trusted app Patterns and after a bit I settled on

([[:blank:]]*)

which looked like it did what I wanted in Patterns' search and replace window. The problem was that transferring this to BBEdit gave me

& 2 & 0 & 1 & 5     &  & S & p & r & i & n & g   &  & 4 & 7 & 7 & 0     &  & 1    &  & 3 & . & 9  &  & 4 & . & 5  &  & 4 & . & 4 & 
 & 2 & 0 & 1 & 5     &  & S & p & r & i & n & g   &  & 2 & 1 & 1 & 0      &  & 3    &  & 4 & . & 4  &  & 4 & . & 5  &  & 4 & . & 4 & 
 & 2 & 0 & 1 & 5     &  & F & a & l & l     &  & 4 & 7 & 6 & 0     &  & 1    &  & 4 & . & 3  &  & 4 & . & 3  &  & 4 & . & 3 & 
 & 2 & 0 & 1 & 5     &  & F & a & l & l     &  & 2 & 1 & 1 & 0     &  & 2    &  & 4 & . & 4  &  & 4 & . & 3  &  & 4 & . & 3 & 
 & 2 & 0 & 1 & 6     &  & W & i & n & t & e & r   &  & 3 & 1 & 0 & 0     &  & 3    &  & 4 & . & 4  &  & 4 & . & 5  &  & 4 & . & 4 & 
 & 2 & 0 & 1 & 6     &  & W & i & n & t & e & r   &  & 3 & 1 & 0 & 0     &  & 2    &  & 4 & . & 0  &  & 4 & . & 5  &  & 4 & . & 4 & 
 & 2 & 0 & 1 & 6     &  & S & p & r & i & n & g   &  & 2 & 1 & 1 & 0     &  & 2    &  & 4 & . & 5  &  & 4 & . & 4  &  & 4 & . & 4 & 
 & 2 & 0 & 1 & 6     &  & S & p & r & i & n & g   &  & 2 & 1 & 1 & 0     &  & 3    &  & 4 & . & 8  &  & 4 & . & 4  &  & 4 & . & 4 &

which is not exactly what I had in mind! After quite a bit of digging around, thinking that the problem was with posix in BBEdit, I finally figured out that the quantifiers are treated differently in BBEdit than in Patterns. The correct version in BBEdit is

([[:blank:]]+)

Patterns for some reason does not treat "*" as actual zero whereas BBEdit does. Using this and

\1 \&

gave me this beautifully formatted text instead

2015     & Spring   & 4770     & 1    & 3.9  & 4.5  & 4.4
2015     & Spring   & 2110     & 3    & 4.4  & 4.5  & 4.4
2015     & Fall     & 4760     & 1    & 4.3  & 4.3  & 4.3
2015     & Fall     & 2110     & 2    & 4.4  & 4.3  & 4.3
2016     & Winter   & 3100     & 3    & 4.4  & 4.5  & 4.4
2016     & Winter   & 3100     & 2    & 4.0  & 4.5  & 4.4
2016     & Spring   & 2110     & 2    & 4.5  & 4.4  & 4.4
2016     & Spring   & 2110     & 3    & 4.8  & 4.4  & 4.4

Now I just need the end of line symbols (and to make the next 14 tables) and I am done!

By the way, instead of the posix version you could use

([^\S\r\n]+)

The same thing apply with the quantifier.

Export Keynote slides to PDF with Keyboard Maestro

I write most of my slides for teaching in Keynote and, as much as I like it for making easy to read slides that are (relatively) nice to look at, it does have some annoyances. The main one for me is when exporting the files for uploading to our course management system. I export everything meant for the students, including Keynote slides, to PDF. It looks the same for all students and with about half of the students using Macs and the other half using Windows, I do not have to worry about them not being able to read it. Now, Keynote has an export option, but for some unfathomable reason it does not remember my preferences from one time to the next and always show the following menu:Keynote's export window

But I want the slides without border, dates, and without showing each builds every single time. I could, of course, click on the check boxes each time I export a set of slides but that gets old really quickly. Keyboard Maestro and some Applescript to the rescue! The screenshot below is of the macro I ended up putting together. Now I only have to use a keyboard short-cut and my slides are ready to download in exactly the format I like them. Keyboard Maestro macro

It took longer to write this than it should have, mainly because I had forgotten how particular Applescript is about referring to windows and sheets. I am sure this could have been written more efficiently but it works and if you want, say, slide numbers you can just change that part of the macro. If you are interested you can download the Keyboard Maestro macro here. As always, use at your own risk.

Taking meeting notes with TextExpander

Inspired by Macsparky's post about taking better meeting notes with TextExpander I spent a bit of time tweaking it. To recap, the basic idea is to have a structured set-up for meeting notes that incorporates action/to-dos for everybody in the meeting. The difference between mine and the original is that mine automatically ignores anybody who is not attending when generating the action items section. It is also edited to allow for similar behavior in both nvALT on my macs and Drafts on iPhone/iPad. You can download the version here. By the way, oa1 is "other attendee 1", oa2 is "other attendee 2", etc. The other attendees are people I work with on a regular basis.