• Time To Learn

  • Be More Productive


  • Archive for February, 2008

    « Previous Entries

    Latest Free and Open Source Mac Software

    Friday, February 29th, 2008

    Todd Ogasawara has continued to publish his Mac FFOSS (Freeware/Free and Open Source Software) column on O’Reilly’s Mac Center. If you’ve fallen behind on what’s new (and cheap) in the Mac universe, you might want to hop over there for a peek.

    Assign one keyboard shortcut to multiple menu items

    Friday, February 29th, 2008

    You may have read the title to this hint and thought “Huh? How can that possibly work? How does the system know which command to run when you type the shortcut? And why would you want to do this?” A bit more explanation is required to see the benefit of this hint: it’s for use with menu items whose names change after they’ve been selected.

    In this case, I wanted an easier way to toggle the display of smileys off and on in iChat (because iChat replaces =$ with a “dollar sign smiley face,” meaning that pasted code often looks quite odd). Disabling smileys is done with View » Messages » Hide Smileys. Easy enough to assign that to Control-S, for example, in the Keyboard Shortcuts tab of the Keyboard & Mouse System Preferences panel. But once you’ve hidden smileys, that menu item becomes Show Smileys, and the keyboard shortcut vanishes. On a lark, I tried assigning Show Smileys the same Control-S shortcut…

    Use Safari 3 textareas to help with form printing

    Friday, February 29th, 2008

    Safari 3 has resizable textareas — multi-line text input boxes — on its forms. This can be a big help when completing a form (for example, submitting a long hint!), but can also help with printing those forms.

    By default, when Safari prints a form, it appears just as it does on screen. This means that any textareas that have more text than will fit in the visible space will show a vertical scrollbar and some of your content will be hidden — not much help for record keeping. However, printing (including Save as PDF) honors resized textareas, so the trick is to make sure you have resized (using the handle at the bottom right corner) to show all your content before printing. You’ll also get better looking output with no scrollbars!

    I use this technique when submitting information to sites that don’t offer a printable version after submission.

    Use Safari 3 textareas to help with form printing

    Friday, February 29th, 2008

    Safari 3 has resizable textareas — multi-line text input boxes — on its forms. This can be a big help when completing a form (for example, submitting a long hint!), but can also help with printing those forms.

    By default, when Safari prints a form, it appears just as it does on screen. This means that any textareas that have more text than will fit in the visible space will show a vertical scrollbar and some of your content will be hidden — not much help for record keeping. However, printing (including Save as PDF) honors resized textareas, so the trick is to make sure you have resized (using the handle at the bottom right corner) to show all your content before printing. You’ll also get better looking output with no scrollbars!

    I use this technique when submitting information to sites that don’t offer a printable version after submission.

    Watch slow motion video on the iPhone and iPod touch

    Friday, February 29th, 2008

    If you want to see something in slow motion — either on YouTube or your videos in the iPod section of the iPhone — here is something for you. Make sure your video is paused, then just tap and hold rewind or fast forward, and your video will begin to play in slow motion.

    [robg adds: I could make this work for the forward direction on my 1.1.3 iPhone, but not backwards. This slow motion feature isn’t noted in the iPhone User Guide anywhere that I could find. By the way, Apple updates the iPhone User Guide somewhat regularly; the third revision was released at the end of January. As an interesting aside, it seems Apple optimized this latest version; it’s about 4MB, versus 10MB for the first version — and it’s actually longer and has at least as many images as the first one.]

    A shell function to make ‘rm’ move files to the trash

    Friday, February 29th, 2008

    Command line users: Have you ever wished rm would put stuff in the Trash instead of just deleting it? After accidentally running rm -rf Desktop one day, I decided it was time to stop really deleting stuff when I ran rm. So I wrote is a shell function — this means that the actual /bin/rm executable works like normal; only when you run rm from Terminal do files get moved to the Trash. This means that programs (and scripts) which delete files won’t be affected.

    So how do you use this? Open Terminal, and edit ~/.bash_profile (this is a script which is run every time you open a Terminal). Run nano ~/.bash_profile from the command prompt if you don’t have a preferred editor. Add the following lines at the bottom of the file:

    function rm () {
    local path
    for path in "$@"; do
    # ignore any arguments
    if [[ "$path" = -* ]]; then :
    else
    local dst=&...

    A shell function to make ‘rm’ move files to the trash

    Friday, February 29th, 2008

    Command line users: Have you ever wished rm would put stuff in the Trash instead of just deleting it? After accidentally running rm -rf Desktop one day, I decided it was time to stop really deleting stuff when I ran rm. So I wrote is a shell function — this means that the actual /bin/rm executable works like normal; only when you run rm from Terminal do files get moved to the Trash. This means that programs (and scripts) which delete files won’t be affected.

    So how do you use this? Open Terminal, and edit ~/.bash_profile (this is a script which is run every time you open a Terminal). Run nano ~/.bash_profile from the command prompt if you don’t have a preferred editor. Add the following lines at the bottom of the file:

    function rm () {
    local path
    for path in "$@"; do
    # ignore any arguments
    if [[ "$path" = -* ]]; then :
    else
    local dst=&...

    A script to download and convert multiple YouTube videos

    Friday, February 29th, 2008

    There are many solutions on the web on how to download YouTube videos using bash scripts, e.g. see this one as an example. However, using scripts described in the above link may be a little uncomfortable if you wish to get lots of YouTube clips. So I’ve modified those scripts a little bit so that the URLs are put into a single file with this structure:

    url1
    name1
    url2
    name2
    ...
    urlN
    nameN

    where urlN and nameN are Nth clip’s URL and desired local filename for the saved movie file.
    YouTube’s FLV files are also converted to AVI format via ffmpeg (see this hint and comments on how to get and install it). I prefer AVI to FLV since most players have problems with FLV movies when it comes to scrolling through them.

    Here is the script:

    Changewave shows that iPhone has opportunity in the enterprise

    Friday, February 29th, 2008

    Changewave today came out with some very interesting business smartphone data. The first bit of information is that RIM’s Blackberry is the platform to beat with nearly three quarters (73%) of the respondents smartphones.

    read more

    10.5: Share files and create sharing users in one step

    Thursday, February 28th, 2008

    It’s certainly well-known that you can setup file sharing very easily in the Sharing panel in System Preferences. But you don’t have to open System Preferences to share files. In fact, you can share files with anyone, even without creating an account for that person beforehand.

    In the Finder, select whatever folder or file you’d like to share and choose Get Info from the File menu (or right- or control-click and select Get Info). Expand the Sharing & Permissions section if it’s not expanded already at the bottom of the window. A lock icon should appear in the lower-right corner of the Get Info window; click it to authenticate. After you enter an administrator username and password, click the plus (+) symbol to display a user-selection dialog. Besides seeing users already created on your Mac, you’ll also see the Address Book along with any groups you’ve created. In addition, …

    A command line crossword solving assistant

    Thursday, February 28th, 2008

    I’d been looking for a simple way to leverage OS X’s built-in Unix dictionary to solve crossword clues, and came up with this little gem of a script:

    #!/bin/bash
    
    echo -n "Please enter a word pattern to search for (use a . for unknowns): "
    read text
    
    echo `grep -w $text /usr/share/dict/words`
    

    Just paste into your text editor of choice, save somewhere, make sure to chmod +x the file and boom, you have yourself a very simple crossword solver! Granted it isn’t perfect, but it’s a good start.

    [robg adds: Just to clarify, the Unix dictionary isn’t the same as the built-in dictionary you access through the Dictionary program. While the Unix words file does hold a large number of words, it doesn’t have everything you’ll find in Dictionary app.]

    10.5: AppleScript ‘path to me’ function changed in 10.5

    Thursday, February 28th, 2008

    When using AppleScript, you sometimes want the running script (or AppleScript Application) to get the path to itself or a file in its resources folder. This is done by using the path to me command:

      set beep_sound to alias ((path to me as text) & ¬
      "Contents:Resources:Sounds:beep.mov") 

    In 10.4, a problem I always found when writing one of these script/apps was that if you tried to test run them in Script Editor, the path to me function would return the path to Script Editor. There where ways around this, but it meant editing the script/app just to test. In 10.5, however, as long as you save the script/app first, then the path to me function will return the correct path to the script/app when tested in Script Editor.

    As an example, this code…

     "display dialog ("The path to me is : " & return & (pa...

    10.5: AppleScript ‘path to me’ function changed in 10.5

    Thursday, February 28th, 2008

    When using AppleScript, you sometimes want the running script (or AppleScript Application) to get the path to itself or a file in its resources folder. This is done by using the path to me command:

      set beep_sound to alias ((path to me as text) & ¬
      "Contents:Resources:Sounds:beep.mov") 

    In 10.4, a problem I always found when writing one of these script/apps was that if you tried to test run them in Script Editor, the path to me function would return the path to Script Editor. There where ways around this, but it meant editing the script/app just to test. In 10.5, however, as long as you save the script/app first, then the path to me function will return the correct path to the script/app when tested in Script Editor.

    As an example, this code…

     "display dialog ("The path to me is : " & return & (pa...

    Fix attachments not loading in iPhone’s Mail app

    Thursday, February 28th, 2008

    I found that attachments fail to download once the iPhone’s scratch disk is full. So when you fail to receive a critical voicemail or document, just reboot — rebooting the iPhone clears the cache (I think it’s 500MB in size?).

    Snowblogging on the iPhone

    Wednesday, February 27th, 2008

    The iPhone is great on the slopes. It plays music, you can communicate with your friends if you want to meet up somewhere, even watch some videos if you are bored while drinking hot chocolate afterwards. Its solid construction also lends itself well to the many falls it incurs when I attempt to showboat down the mountain.

    Today, I am adding blogging to the list of things to do with the iPhone on the slopes. Check the video!

    read more

    Are malware writers targeting Macs?

    Wednesday, February 27th, 2008

    One vendors says organized crime has discovered OS X. Maybe. Maybe not.

    read more

    Apple announces shiny, “new” laptops (and 2008 decided)

    Wednesday, February 27th, 2008

    Boom! It’s IT Blogwatch: in which Apple unveils refreshed MacBooks and MacBook Pros. Not to mention our shadowy puppet-masters…

    Gregg Keizer reports:

    Apple Inc. … refreshed its laptop lines by shifting to faster, more power-efficient 45-nanometer Penryn processors from Intel Corp. and bumping up the size of the systems’ hard drives. Prices for the new MacBook and MacBook Pro laptops remained unchanged …

    read more

    Comparison: New MacBook Pros and two year old Revision A MacBook Pro

    Wednesday, February 27th, 2008

    As expected, the new MacBook Pros were released yesterday. Apple upgraded the processors and hard drive configurations and added multi-touch features to the trackpad. But, is there a reason to upgrade my two year old MacBook?

    read more

    Comparison: New MacBook Pros and two year old Revision A MacBook Pro

    Wednesday, February 27th, 2008

    As expected, the new MacBook Pros were released yesterday. Apple upgraded the processors and hard drive configurations and added multi-touch features to the trackpad. But, is there a reason to upgrade my two year old MacBook?

    read more

    MacBook Updates - Multi-touch Makes the Rounds

    Tuesday, February 26th, 2008

    Apple’s latest updates to its MacBook Pro line includes the MacBook Air’s multi-touch trackpad while other updates to the MacBook and MacBook Pro focus on speed, RAM, and storage.

    read more

    « Previous Entries