Tag Archives: tech

Sunday Nerd Out: Apple Scripts in Quicksilver

Well, it’s not been a good day; my less-than-six-month-old PowerBook appears to have eaten its hard drive.

The good news is that between moving everything up to Google Docs/Gmail/Google Calendar and doing hourly Time Machine back ups very little has been lost (though, I hadn’t done a Time Machine back up since Friday night). Knock Wood.

I’m using Marci’s MacBook until my appointment tomorrow with the ill-advisedly named “Geniuses” at the Apple Store. This requires me to get her machine to operate the way I like my machine to operate, which essentially means installing Quicksilver and getting my Triggers going.

Perhaps in a feeble attempt to overcome feeling helpless about my hard drive dying I decided to solve a problem I’ve had with Quicksilver that’s been bugging me for some time: my inability to figure out how to hide apps using a trigger.

Opening an app with a trigger is as easy as can be:

1. Pull up QS
2. hit command “;” to get to the preferences
3. go to Triggers
4. hit the “+” key
5. access the app you want to open in the top panel
6. tab to the second, “Action,” panel and (if it doesn’t already display it) hit “O” to coax the “Open” command to appear in the Action panel
7. Hit Save and then click on the Trigger section and put whatever keystroke you want as the trigger (if, like I do, you want to use the Function keys (F1, etc.), you’ll need go to the “Keyboard and Mouse” System Preference panel and check the box that says, “Use all F1, F2 keys as standard function keys”)

You can now use the function keys to pull up pretty much whatever you want; for me F1 pulls up Safari, F2: Firefox, F3: Tweetie, etc.

The problem I wanted to solve is that I’d like to be able to quickly hit a modified function key to hide these apps. For instance, I wanted to be able to hit [Command F1] to hide Safari after I’d used “F1″ to pull it up.

You’d think that’d be easy, and there may be an easier way than what I’ve come up with, but a little apple scripting goes a long way here.

To hide any app do the following:

1. Pull up QS as described above in steps 1 thru 4
2. Now in the top panel (“Select an item”) of QS type a period: “.” – this tells QS that you want to enter text
3. Use the following script and substitute whatever app you want to hide for where I have “Safari”:

tell application “System Events” to tell process “Safari” to set visible to false

4. You’ll note that as soon as QS realizes you’re putting a script into its first panel (via the words “tell application”) the second (“Action”) panel changes to “Run as AppleScript
5. Hit Save
6. As above, in Step 7, click on the keystroke area and enter in whatever key or key combination you want to use to, in this case, hide “Safari.” As I’ve said, I use a modifier of the key I use to open, so F1 opens safari and [command + F1] hides it

This may seem like a lot of trouble, but I promise you, those actions of moving your hands from your keyboard to your mouse and back again add up.

How to Change the Heading Styles in Google Docs

So I’m pretty close to never opening any Microsoft Office apps. I’ve moved completely from Entourage to Gmail and Gcal. All of my presentations are done in Google Presentation, the vast majority of my spreadsheets in Google Spreadsheet, and, naturally, my documents are written in Google Document.

With the awesome Manymoon providing a seamless layer of organization to all of these Google apps (as well as being a kick ass product management app), I really don’t miss MS Office at all.

Except for a few minor annoyances, there’s really no reason to open Office. One such annoyance was the inability to change the standard size, color and font choices for the Headings. This irked me, because the supplied heading qualities really look sort of terrible in the context of most docs; too big, too bold, too much deviation between the point sizes from Header 1 (VERY big) to Header 2, (not proportionally big), and so forth.

Here’s a screen grab of the standard headers:

As you can see, Header 4 – at 10pt type – is a smaller point size than typical 12 point body text type. This means it looks terrible.

Happily, Google recently made it easy to alter the CSS of the doc. Go to Edit > Edit CSS, and you’re greeted with a blank screen where you can add any CSS elements you want.

To change the Heading Styles, I added this:

h1
{ font-family: Calibri;
font-size: 16pt;
color: #336699; }

h2
{ font-family: Calibri;
font-size: 15pt;
color: #336699; }

h3
{ font-family: Calibri;
font-size: 14pt;
color: #336699; }

h4
{ font-family: Calibri;
font-size: 13pt;
color: #336699; }

Now the headers look like this:

It’s obviously very easy to change the elements for Headers (or anything else). Do note that all you’re doing is changing the CSS for the document you’re actively working on, and not globally. I have a feeling that option will show up soon.

Another steak in the heart of MSFT.