Skip to content

Mac OS X Hints

My most-useful and least-used shell script

I have a large number of small shell scripts I've either written or collected over the years. Today I had the opportunity to use my favorite one—which is rare, as I only need it a couple times a year. But when I do need it, it's a wonderful little script.

It's also a very simple-minded script, as it does just one thing: it copies my public IP address to the clipboard and shows it in a pop-up message, as seen at right. OK, so that's two things, but they're very closely related.

Clearly this isn't something I need to do often, but when I do, the script changes this…

Switch to browser, open new tab, load the DynDNS check IP page, drag mouse to select IP address, press Command-C to copy, switch back to destination app, press Command-V to paste

…into this…

Press a key combo, wait about a second, then press Command-V

This is a big timesaver, obviously, and it makes the process about as easy as it could be.

I originally wrote this up for Mac OS X Hints a few years back, but thought I'd post it here (given the changes at Macworld, I'm not sure how long the hints site may be around). I've also modified it a bit, as I no longer use growlnotify for the onscreen display of the copied IP address.

You can read the original how-to at hints, or below, where I've posted the updated version that no longer uses growlnotify.

[continue reading…]



Search the iTunes Store from anywhere

This morning, I wanted to send someone an iTunes App Store search URL, so that when they clicked it, they'd see the list of matching apps in the iTunes App Store. There's no apparent easy way to do this within iTunes, but after much futzing about, I figured out how to structure a URL that will open to to the search results screen in the iTunes App Store.

Because Apple has separated iPhone apps and iPod apps in the store, there are actually two separate URLs, one for each type of app. The iPad version of the URL is:

itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?entity=iPadSoftware&free=0&genreIndex=1&media=software&restrict=false&softwareTerm=TERMS+TO+SEARCH+FOR&submit=seeAllLockups

And for the iPhone, it's identical except for the entity bit:

itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?entity=software&free=0&genreIndex=1&media=software&restrict=false&softwareTerm=TERMS+TO+SEARCH+FOR&submit=seeAllLockups

Hopefully obviously, replace TERMS+TO+SEARCH+FOR with the keywords you want to use for the search, separating words with the plus sign. You can then use the URL for whatever you like: send it to someone, add it to your bookmarks bar, whatever. When clicked, the search will run and the results will open directly in the iTunes App Store for either iPad or iPhone apps.

For example, iPad Apps related to the word foobar, or iPhone apps about hopping frogs.

You can further customize the URL to find anything you want—not just apps, and using additional criteria—within any of the various areas of the App Store. Read on for the details on how to do that.

[continue reading…]



A look at the first eight years of macosxhints.com

I was cleaning out some old images from the site, and found over 150 apparently unused images. Whoops, that's what nine years of bad housekeeping will get you.

One of the leftovers, though, was kind of interesting. At some point in time, I graphed the number of hints published each day on macosxhints.com, from launch through 2008—a total of 12,051 hints.

Even if unlabeled, it'd be pretty easy to figure out where the major OS X releases occurred (except for 10.1, not sure what's up with that?). And you can see a general downward trend in hints per day, as the OS became more established (and more locked down) over time.

In any event, I thought it was an interesting chart, and figured I'd toss it into a quick post instead of just sending it to the dustbin.



Control is the key to avoiding needless dialog boxes

Over the weekend, I wrote myself a little AppleScript program that makes it much easier to create license files for our customers. (Given my lack of knowledge on AppleScript, I'm quite happy with the result.)

To make it easy to use on all my Macs, I stored the finished result in Dropbox. I tested it using my MacBook Pro, assigning it a global keyboard shortcut using Butler. It worked great; as soon as I typed the shortcut, I'd see my "Which program?" onscreen dialog, and all was good.

When I got back to my iMac, I used Butler to point to the same script on Drobpox, and tested it. I was very surprised to see that, instead of launching my app, OS X presented this dialog box:

Confused, I pulled out the MacBook Pro, and tested again…and again, it worked fine, launching without any confirmation dialog.

After many minutes of hair pulling, I figured out the problem: On the MacBook Pro, I had assigned the shortcut as Shift-Option-M; on the iMac, I decided that it'd be easier to type Shift-Control-M, so that's what I used (intending to change the MacBook Pro to the same shortcut). As soon as I removed the Control key from the shortcut, my application loaded without the confirmation dialog.

I've been unable to figure out why this happens, but if you're launching AppleScript apps via global shortcuts, avoid using the Control key in those shortcuts (unless you like needless confirmation dialogs, that is).



How to use Safari to track The Masters leaderboard

In general, I don't use Safari—mainly because I'm addicted to the add-ons I get with Chrome and Firefox. (Yes, I know Safari has extensions…but they're underpowered and feature limited compared to what you can get in the other browsers.) However, during Masters week, Safari has a key role in my following the tournament, thanks to one key feature: web clip, i.e. Open in Dashboard.

While The Masters has an excellent iPad app, I don't like having the iPad locked into one app for hours at a time. So, to follow the leaderboard, I turn to Safari's Open in Dashboard feature, along with a favorite old Mac OS X Hints hint that allows me to drag widgets out of the Dashboard. Using these two things together, I can view the full Masters leaderboard, floating in a window all its own.

Best of all, the interactivity of the leaderboard is preserved, so I can re-sort the list, expand a player's scores, and do all the other things I can do on the actual leaderboard page.

Note that you'll need some spare monitor space for this trick: the dragged Widget floats over every other window, so it will get in the way if you're using, for instance, an 11" MacBook Air.

If you'd like to do the same, here's how…
[continue reading…]



A workaround for an iPhoto/set desktop picture bug

On both my Mac Pro and my iMac, I've run into a problem where the iPhoto library simply doesn't show up in the Desktop & Screen Saver System Preferences panel (in Mac OS X 10.6.x). Well, sometimes it shows up, but simply as a line reading iPhoto, but without any actual content.

When this happened the first time, I looked in Console and found the following entry for each time I'd tried to load the Desktop tab of the Desktop & Screen Saver panel (reformatted for easier reading):

1/12/12 9:09:36 AM      System Preferences[4134]
**** DesktopPref error: DSKiPhotoRootSource -loadData TIME OUT!!! There something wrong with iLife Media Browser

Googling on that error led to a number of pages, including iLife: Cannot See iPhoto Files in Other iLife Applications on Apple's support site. But after trying everything in that article, I still couldn't see my iPhoto images when trying to set the Desktop picture.
[continue reading…]



Feedback from readers

Macworld logoAs you might guess, I get a lot of email from readers of Macworld and macosxhints.com. For the most part, I love hearing from readers -- even if it's negative feedback, believe it or not. In the case of negative feedback, however, it's nice if the writer provides enough detail so I know (a) what they're upset about, and (b) what I might be able to do about it. I've actually had many useful and productive exchanges with folks who wrote to flame me for one reason or another.

However, on the opposite side of the fence, as an example of the kind of useless feedback I hate receiving, I offer up this email that arrived this morning:

Do you proof read these articles before you publish them?

That was the entire email. I have no idea which typos the author may be referring to, nor for that matter, which one of the 20 to 30 things I wrote last week that those typos may be in. It's also somewhat ironic to note that proofread is one word, not two -- if you're going to chastise me for typos, it's best not to make any of your own!

I really do enjoy hearing from and corresponding with readers. But if you're going to take the time and effort to write to me, at least include enough information for me to understand what it is that's gotten your attention, so that I have some context for your comments and can respond in a meaningful manner.



The downside of public hint submissions

In general, I wouldn't change a thing about the way OS X Hints has worked out over the years -- I've learned a ton, had a ton of fun, and even managed to completely change my career. One of the first things I did right (through sheer luck, more than anything else) was to choose a content management system (Geeklog) that allowed for public story submissions. With the whole community participating, the hints collection has grown at a tremendous rate.

Lately, though, the downside of public submission queue has become apparent: spam submissions. As an example, here's a bit of what I saw in the queue this morning:

spam

There were well over 100 such entries, all of which were added between Friday morning and early Monday morning. Ugh. (Geeklog presently lacks any sort of captcha on story submissions, though I think there's one in the works for the next minor update.)

So instead of spending time reviewing, editing, and posting hints, I spent the first 10 or so minutes of the morning identifying all the spam entries and deleting them from the system. Clearly these are automated scripts at work, hoping to hit sites that use unmoderated submissions. They care not if a site is moderated, obviously, though it certainly puts me in a foul mood as I clean up their detritus. Sigh.