Auto save IDML files when you close an InDesign document

Recently, I ran into a problem with coworkers having trouble editing my InDesign files. I run CC2017 but they often run older versions, anywhere between CS6 and up. To avoid this issue, I often export IDML files.

I like making the computer work for me so I automated the process. I came across this script from fabiantheblind. It saves an IDML alongside your INDD file every time you save the document.

I took the script and modified it so that it would only fire after I closed the file. Since I'm trigger happy with CMD + S, this saves me precious disk writing/CPU cycles not to mention any network hangups when working on an AFP/SMB server. 

To get this set up, create a Startup Scripts folder in your InDesign Scripts folder. You can also use the Install Scripts tool by Olav to simplify the process.

Download the script and copy it to your Startup Scripts folder. Restart InDesign.

Now, every time you finish editing an INDD file and you close its window, the script will trigger and create an IDML. While I've tested this on my Mac, it should work on Windows. 

(sometimes, you may run into a Doc was never saved error. Double check your directory to see if the IDML file was saved regardless. It has worked every time for me so far.)

I've recreated the code below:

// This InDesign Startup Script saves an IDML copy of the doc alongside the INDD
// Save it in your Startup Scripts folder. (See
// Thanks to fabiantheblind for the original script
// Modified by Ashraf ( for comment & code clarity as well as functionality on close

#targetengine "session"
// Activate a Target Engine to make this work. See

app.addEventListener('afterOpen', function(myEvent) {
  // Only run once a document is opened. See
  if(app.layoutWindows.length == 0) return; // This is here to avoid a run on first start when there are no windows 

  var doc = app.activeDocument; // Get the current doc

  // Switch to the event listener
  // If you want it to work on every save, change variable to afterSave
  app.addEventListener('afterClose', function(theEvent) {
    $.writeln('saving'); // just to see whats going on
    if (!doc.saved) {
      // catch those possible mistakes
      alert('Doc was never saved');
    var aName =; // get the name
    var newName = aName.replace("indd", "idml"); // replace the INDD to IDML
    // Create a new File Object next to the INDD
    var theFile = File(File(doc.filePath).fsName + "/" + newName);
    // export
    doc.exportFile(ExportFormat.INDESIGN_MARKUP, theFile, false);

My thoughts on Warren Buffet’s Letter to Berkshire Shareholders

I don’t really know what compelled me to read Warren Buffet’s yearly Berkshire letter. I’ve never read it before. But I’m glad I did.

It dawned on me that a 29 page document set at 11 point in Microsoft Word, may not be the most interesting read. But I set out to print a copy and read through each one. On the train and reclining at home, I pored through the numbers and the analysis.

To be honest, the density of the numbers/math kind of flew over me. I should stop saying math is difficult, but here I am again—math is really difficult for me. But strictly, I’m here for the analysis.

Right off the bat, Buffet does something interesting: he expresses humility. A humility in his own failure to invest properly, and making poor investment decisions. To be able to come to such a conclusion requires a gargantuan set of balls, and a destruction of the ego. But that’s not a big deal for a man who is often considered the wealthiest.

Buffet embraces humanism and capitalism in the same breath.

It's also interesting how Buffet embraces humanism and capitalism in the same breath. He talks about the stretching of money as if it was a pliable material, always elastic, never compromised. When he converses about his staff, other investors, and the larger American economy, he is bold, brash, and kind.

His opinions are remarkably simple. You get a sense that this man deeply believes in making sound financial investments. It nearly elicits a ready joy on the horizon whenever he talks about money. Take this statement for instance, “Americans have combined human ingenuity, a market system, a tide of talented and ambitious immigrants, and the rule of law to deliver abundance beyond any dreams of our forefathers.” He doesn’t mince words for a second. His vision on the American dream is clear, and the undertone of possibility is rich.

I also did not get the impression he was greedy or self-centered. He elevates a discussion on immigration, alluding to the great power of American innovation is fueled by the diversity of those entering this nation. He also talked about reducing costs for paycheck-strapped customers trying to pay their electricity. He talks about the loan forgiveness programs on home loans and prides himself with more people having more roofs.

His political views are clearly liberal, but also set with an America-first principle. Take for instance, his approach on maintain cash reserves here in America, versus overseas like most multi-national conglomerates. He understands the American tax code and flexes it in such a way that you’d think the lawyers would buckle under pressure.

He is also a businessman first and foremost. He sells his investors GEICO, over and over again. Through the subtle art of repetition, he drills home the value of his investments (nee Berkshire) to his shareholders. And it’s a compelling argument. A solvent company with a solid product meets a buyer in need of a service.

He even placed (huge) bets as a validation for his financial theories, and as a lesson to investors (and non-investors) everywhere. His recommendation, to invest in a Low Index S&P 500 fund, against the employment of financial managers who charge exorbitant fees, is clear.

Buffet intermingles human behavior, experience, and money making into a cohesive system.

For example, he reconciles that the wealthy individual is fooled into using financial managers because they’ve been trained their entire life to enjoy luxury services. Why not pay for a product, it should provide a better answer? But Buffet is saying, wealthy people, stop it! Stop this nonsense. Invest in a Low Index S&P 500 Fund. You will do better in the long run.

Everyone that participates in the financial picture is a target of Buffet’s opinions. Financial managers, investors, shareholders, accountants, bookkeepers, tax men and women, legislators, politicians, wealthy and poor individuals, and America as a whole. He dishes out honest, pointed advice to promote a good financial attitude.

I like the little bits of advice as well. A few nuggets:

  • What is easy with millions, struggles with billions.
  • Charlie and I love our railroad (so do I!)
  • We like to make hay while the sun sets, knowing that it will surely rise again.
  • When others are constrained, our choices expand.
  • What is smart at one price is stupid at another.
  • Every decade or so, dark clouds will fill the economic skies, and they will briefly rain gold. When downpours of that sort occur, it’s imperative that we rush outdoors carrying washtubs, not teaspoons.
  • As in the case in marriage, business acquisitions often deliver surprises after the “I do’s.”

Even the way he talks about the annual Berkshire meeting is lovely, human, and a marketing 101 refresher in clear communication.

Once I looked past the financials and mined for insights, I struck gold. Buffet is a snowflake investor that deserves careful consideration, and his opinions might even make you a little more wealthier (at least I'm wealthier with my new knowledge).

If you haven't already read Warren Buffet's letter, I highly recommend it. I know I'll be back again to read next years'.

Solving the mystery of HDMI handshake issues with my Apple TV and Yamaha Receiver

For a year now, I’ve been dealing with HDMI handshake issues on my Apple TV 4th generation where the picture would have an overlay of snow particles. 

All the snow interrupting my beautiful pixels.

I use a Yamaha RX-V477 Receiver as my main input device. Its full gamut of HDMI compatibility plus built in AirPlay functionality and 5.1 channel support is fantastic. That’s why I was flabbergasted when I first plugged in my new Apple TV experienced the twinkling snow on my picture. The only way to get around the issue was to downgrade to 720p resolution. 

I had conducted some Google-fu but found very little regarding HDMI handshake/snow issues. An Apple knowledge base article recommended connecting the Apple TV directly to the television. To my surprise, all the pixels were rendered in full 1080p, no snow! However, I had to work around the sound by connecting an Optical Audio Out from my Pioneer Kuro Elite to my receiver. This fix was also no good as the cable only provided 2.1 audio.

I was hot swapping between my receiver and television to try and determine the source of the problem. At one point, I noticed that the Apple TV directly connected to the TV was flickering in and out. Huh? It was just working a day ago.

Upon closer inspection of my HDMI cables, I noticed I had different variants from different manufacturers. They all stated their “High-Speed” quality, but no versioning or other features. Perhaps this was the ticket. 

I ordered a fresh cable from Amazon with the latest HDMI 2.0 standard. I used it for the main output one the receiver to the television. Then, I used an existing cable that I knew worked with the Apple TV, and set it to one of the inputs on the receiver. 

Tada! No more snow, no more HDMI handshake issues. I was blaming my receiver and my television when it turns out, the HDMI cables had different standards. 

A working, 1080p signal with 5.1 audio from my Apple TV 4th Gen, via my Yamaha Receiver

With all the trouble I had with HDMI cable standards, I wonder how big of a mess we’ll have with transition to USB 3’s different standards (and cables)? Perhaps USB 3 will be the standard to kill all standards (until everything goes wireless).

Pasting and formatting rich text in InDesign

In the advertising world (and really, the corporate world), I usually receive my manuscripts in Microsoft Word format. That means, I'll come across documents with formatting that needs to be carried over into InDesign. I use an InDesign preference tweak in order to copy and paste formatting from any rich text editor.

To change this option, go to InDesign Preferences > Clipboard Handling and select "All Information" under the Paste group. This works as a global setting for all your InDesign documents. If you want to bypass formatting, you can use the Shift key when pasting, and still have clean, unadulterated copy.

A tiny issue: when I pasted the copy with formatting, it carried over the font and size from Word. To match my document format, I apply Basic Paragraph style to restore the font and size. Depending on your font, you might be done in this step. If you still have some missing formatting, Then, to deal with the missing formatting, I use the Find Font tool located in the Type menu to replace all the font instances.

This saves me a ton of time when I work with APA references that have bolding and italics for journal names. For more information on what is carried over when you copy and paste using this setting, check out this awesome InDesign Secrets article.