Tuesday, August 30, 2016

Reopening Old Google Chrome Tabs

I have Google Chrome (GC) configured to open whatever tabs were previously opened when the browser was closed. This setup is great since I often have 10-20 tabs open, and reopening them 1 by 1 would be a pain.

Unfortunately, what happens is that sometimes I'll have 2 separate GC windows open, usually one of them with 20 different tabs (let's call it A) and another with only 1 tab (called B).

A problem occurs if I close the window A first and then window B. Since GC only remembers the tabs on the last window (B) that was closed, when I restart GC it gives me the tabs from window B. Bummer.

There is another feature in GC that let's you open a closed tab. The keyboard shortcut is Cntl-shift-Tab. When you accidentally close a tab, just type the keyboard shortcut and it reopens the closed tab.

And now for the cool part....

When you open GC, if you type Cntl-shift-Tab, it reopens a closed tab from even before you closed the browser. I my case above, when GC is restarted, window B opens. If I type Cntl-shift-Tab, it opens browser window A that was closed!

Wednesday, August 24, 2016

Count the Number of Words using JavaScript in Adobe Acrobat

This is the best hack that I've come across in the last several years.

Many times I wanted to count the number of words in a PDF document. The normal way to do this task is to save the file as a Word doc and then open it in MS Word that calculates the count. You can also upload your file to an online site that will count it (although most companies would probably frown upon sending your precious data to some random 3rd party site).

Today I stumbled across an Adobe forum thread that said that Acrobat can run JavaScript. Hmmm... And then I found another site that explains how to create a custom tool in Acrobat. Put these two together and you get a toolbar button in Adobe Acrobat to count the number of words in the doc.

Here's how to make it work. Note that this is for Acrobat DC.
  1. Open Acrobat.
  2. Click Tools.
  3. Click Action Wizard.
  4. In the button list under the toolbar, click New Custom Command.
    This window opens:

  5. Click Execute JavaScript.
  6. Change the Label to something useful, like "Count words in document".
  7. Change the Tool tip to something useful, like "Counts the number of words in the current document".
  8. Click Command Options...
  9. Paste in the following code:
    /* Count number of words in document */
    var cnt = 0;
    for (var p = 0; p < this.numPages; p++) cnt += getPageNumWords(p);
    app.alert("There are " + cnt + " words in this file.");
  10. Click OK.
  11. Click Don't show options, options are always the same.
  12. Click OK.
You now have a custom command. All that's left to do is make the button that calls it.
  1. Right-click in a blank part of the toolbar.
  2. Click Customize Quick Tools.
  3. Expand the Action Wizard section.
  4. Find your new command and select it.
  5. Click the Add to Toolbar button on the right side of the window.
  6. Click Save.
That's it! You can now open any PDF and just click the button to get a word count.

[Source: KHKonsulting and Adobe]

Sunday, February 28, 2016

List of Conferences for 2016

Over at Firehead, they have a nice list of conferences for this year. Go to one. Learn something new. Schmooze with people. See their site for more details.
FEBRUARY

MARCH

APRIL

MAY

JUNE

JULY

SEPTEMBER

OCTOBER

NOVEMBER