TextExpander media review snippet with auto IMDB metadata

TextExpander is an application that can automate routine typings on your Mac, and I think it is one of those must have apps for your Mac. Beyond the conventional text expanding capabilities, TextExpander supports AppleScript and Shell Script.

Inspired by David Sparks’ media review snippets, I decided to create my version that can automatically import some key metadata from IMDB.


  1. I open the IMDB title page for the movie that I want to review (i.e. http://www.imdb.com/title/tt1375666/)
  2. start a new entry in Day One (Day One is a great journal app)
  3. expand the snippet (my abbreviation is “xmov”)


Without manually copying-and-pasting, you instantly get the following: link to the IMDB title page specific to the movie, IMDB rating, director(s), writer(s), actors, and a quick summary. I don’t have to type or copy-and-paste any of these. With a brief keyword(;mov), I get all the metadata that I want to include in my review in a pre-formatted Markdown. Actor/writer/director names are links, which allows me to further read about a particular individual if I am interested in him/her.



  • Despite my messy script and set-up, everything should work within a second.
  • IMDB does not have an official API, so I parsed the actual title page (html). There are some third-party APIs available, but parsing the HTML source works fine.
  • In this particular solution, AppleScript captures the URL of the IMDB page from Safari and passes it to the Python script that actually does the job. This whole thing can be duplicated only using AppleScript. Despite the inconvenience and additional complexities of having two scripts system, I wrote the main script in Python since I am much more comfortable with Python than AppleScript.
  • unfortunately, Day One does not fully support AppleScript. There is a CLI (command-line interface) for the app, but it is relatively limited (no tagging support).


  1. TextExpander
  2. Python 3 (some modifications are needed for Python 2)
  3. BeautifulSoup (a Python package used here to parse strings). Check out You can do “pip install beautifulsoup4” on Terminal (depending on your set-up, you may need “sudo”) or Google it to find out how to install the latest version.




A Musical Tribute to Science

In the dawn of the 20th century, the United States was enjoying the period of tranquility. This also applied to science—particularly in physics. Some scientists in the 19th century even suggested that the world of physics had reach the point of perfection. Then, there was an experiment—the one that shouted a wake up call to the era of complacency and signaled the new developments in physics.

Physicists knew that a wave must travel through a medium—such as sound waves traveling in air and waves propagating on water. From these observations, physicists questioned: how does light wave propagate? what is the medium of light wave? They thought that the universe must have something for light—the one that had not been detected yet. In order to solve this piece of inconsistency, people theorized a new medium called “luminiferous aether”—a non-viscous and invisible fluid that fills the empty space to serve as the medium of light wave. Some even theorized the properties of this fluid, and the only thing left was to prove the existence of it with robust empirical evidence.

In the late 19th century, Albert Michelson at Case Institute (now the Case Western Reserve University)—with a help of his friend Edward Morley—devised a concise and “irrefutable” experiment to prove the existence of ether. Michelson was unquestionably qualified for such experiment, considering his abilities to construct extremely precise optical apparatus. However, despite all the meticulous set-ups and observations, Michelson failed to observe the “ether,” and the result was further corroborated with the evidences from other experiments. After all, it became “the most famous failed experiment,” and Michelson became the first American scientist to be awarded the Nobel Prize.

It was a significant discovery and an exciting piece of scientific history that deserves a commemoration. Philip Glass—one of the most highly regarded and controversial composers of our time—was commissioned to compose a piece to celebrate the centennial anniversary f Michelson-Morley experiment.

It seems to be that the overall structure of the music was inspired by the experiment and its implication. The piece begins with slow and repetitive motif—resembling the tranquility, and it slowly accumulates and expands into a sense of excitement and discovery. The piece tirelessly repeats the main motif—which reminds me of a beam of light constantly reflecting while it travels the universe, and it is quite interesting to see how it develops and transforms throughout the piece. It also vividly paints light, particularly the sun as the source of astonishing amount of energy and the inception of the life on earth. The relentless repetition finally slows down and the music peacefully fades away while sense of optimism and hope resonates—symbolizing the new chapter of modern science ahead. The dawn has passed, the sun is rising, and it is finally the time to wake up.

“This is a portrait not only of the two men for whom the experiments are named but also that historical moment heralding the beginning of the modem scientific period”.

— Philip Glass