CrabApple Forest |

Picking The Good Ones & Crabbing About The Bad Ones

Free eBook to help you begin programming on OS X

Tuesday Apr 15, 2008

Here at CrabApple Forest we’re always a sucker for free Mac-related things, and we just came across a free e-book that will help you learn to write software for the Mac, should that be your desire.

Become an Xcoder

Quoting from the blog of one of the authors:

Become an Xcoder is a free little eBook we wrote to help beginners with no or little programming experience to start their journey into the world of Mac OS X development with Objective-C and Cocoa. (See Learn Cocoa for a recent discussion on this topic).

 I’m glad to announce that the book has been updated for Leopard and Xcode 3, thanks to the work of Alex Clarke (one of the original authors and our publisher at CocoaLab). You can download the PDF of this new edition.

For additional details including more information on where to find related learning materials, see this blog post.

We have the feeling that some people will be able to pick this up fairly easily, while others possibly never will. For those that "just don’t get" Objective-C and Cocoa, there’s always AppleScript and/or Automator workflows, about which we’ll most likely have something to say in upcoming articles. No matter which language you use, we hope you can write some really great software for the Mac!

Related posts


CrabApple Report: Firefox blocks popular Mac site

Monday Apr 14, 2008

One of the sites we visit fairly regularly is called Cool OSX Apps - we subscribe to their newsfeed, and when we see something interesting, we’ll stop by their site. We’ve never had a bit of trouble with them until today, when suddenly Firefox 3 (beta 5) decided that it wasn’t going to permit us to go to their site. Like some sort of overzealous nanny, it popped up an ominous warning in the middle of a black background:

Firefox reported attack site warning

So, naturally we clicked on "Why was this site blocked?", which took us to a big page of information that told us the following:

One or more StopBadware partners are reporting badware behavior on this site.

Reporting Entities

This site is currently (as of 04/14/2008) being reported to StopBadware by the following partners:

Google: reported bad

And on another part of the page…

What is this page?

This page is StopBadware’s information page about www.coolosxapps.net/.

Google has found that some portion of www.coolosxapps.net/ contains or links to badware or otherwise violates Google’s software guidelines.

Some websites intentionally distribute harmful software, while many others have been compromised without the knowledge or permission of their owners. StopBadware reports information provided by Google about these sites (see ‘Reporting entities’ to the left) and offers a process to assist webmasters in removing their sites from Google’s list (see ‘I am the owner of this site’ below).

For StopBadware’s guide to understanding Google’s warning pages, see our Frequently Asked Questions (FAQ).

For more information about StopBadware, click here.

Our problem with this is that first of all, this gives us no idea as to whether there really is a threat on this site or not. We doubt the site is any more of a threat than it was yesterday, but sometime in the last day or so, someone at Google or StopBadware decided that we, and anyone else who uses Firefox as our browser, should not be allowed to go to that site. As best we can recall, we never asked for this sort of intervention, so we resent it the way we would resent a busybody neighbor who starts giving unsolicited advice about what we should or should not do "for our own good."

The thing is, had we not been visiting this site semi-regularly for the past few months, we might have been genuinely scared off by this dark red warning on a totally black background. Even the colors were apparently picked to convey a sense of impending danger. This in itself is not a bad thing. There are many inexperienced users on the internet and this color scheme will get a new your attention.

We don’t know about anyone else, but we don’t want either Google or StopBadware denying us the ability to access a site, unless they are willing to tell us precisely what they think is wrong. At our age, we’re not going to accept "Because I said so!" from anybody, even if one of the parties is Google.

So, we dug around in Firefox’s preferences, and on the Security panel we found there is a checkbox you can use to turn off this dubious "assistance":

Firefox security panel
Uncheck the box, "Tell me if the site I’m visiting is a suspected attack site" and you gag the nanny. Should you do this? That’s up to you. We did, because we’re not going to let some entity with unknown motives (be it Google or StopBadware) decide whether we can get to a web site.

There are at least three things wrong with the way Firefox implements this. First, the warning doesn’t need to be dark blood red on black… that’s just over the top, and needlessly ominous. Second, they need to explain EXACTLY why they are declaring a site bad - for example, if the site happens to have one link on it that will cause us problems if we click on it, then tell us about that link and we’ll be sure to avoid it. But, don’t declare the entire site off limits!

And third, the warning needs a button that allows you to go to the site anyway. Even if it says something like "Okay, you’ve warned me, I’ll take the risk" or something like that, there needs to be a way for a user to bypass the warning on one site without turning off the warning for all sites henceforth.

Right now, the only site we really want to block is StopBadware, until they decide that they should give users enough respect to explain why they are warning about a site. The heavy-handed approach used in Firefox 3 is totally repugnant to us.

As a final comment, we know there are bad people out on the Internet, but we fear that we are all getting too many warnings. For example, every time we download some software program from the Internet, the first time we try to run it we get a warning that this is something we downloaded. No fooling! What a useless warning. It doesn’t tell us anything about whether the software is safe to run, it just acts as though all downloaded software is potentially unsafe, so it had better make us click an extra button before we run it - which by now we do mechanically. If there were ever a real threat, we’d probably click right through and let it run.

Haven’t parents been reading the story of "The Boy Who Cried Wolf" to their children lately? Because it looks to us like the makers of browsers and operating systems sure never heard it.

Related posts


Screen capture programs for the Mac

Monday Apr 14, 2008

One of the challenges of doing a blog such as this one is getting screenshots of various programs in action, so you’re not just reading plain text. Sometimes you can find appropriate screenshots already provided on a web site, but in other cases you have to try and take them yourself. The Mac has a built-in screen capture facility, but it’s not anything simple like pressing a Print Screen button. Instead, there are actually six options, none of which are exactly intuitive:

  • Command-Shift-3 captures the entire screen area and saves it to a file on your desktop
  • Command-Control-Shift-3 captures the entire screen area and saves it to the clipboard
  • Command-Shift-4 gives you a crosshair cursor. You position it at the starting point, click the left mouse button, and drag to select the area you want to capture. Upon releasing the mouse button, the screen shot will be saved to a file on your desktop.
  • BUT if you use Command-Shift-4 and then press the spacebar (instead of using the mouse to define the area), the crosshair changes to a camera. Now use the mouse to drag the camera to an application window you wish to capture, click the left mouse button, and it will capture the entire window to a file on your desktop (including the drop shadow effect).
  • Command-Control-Shift-4 operates in the same way as Command-Shift-4 except it copies the screen capture to the clipboard.
  • BUT, Command-Control-Shift-4 followed by a press of the spacebar changes the crosshair to a camera, and now operation is the same as if you had pressed Command-Shift-4 followed by the spacebar, except the capture now goes to the clipboard.

And under Leopard only, there are additional possibilities - any of the following keys can be held down while selecting an area (using Command-Shift-4 or Command-Control-Shift-4):

  • Space - this locks the size of the selected region and moves it when the mouse moves
  • Shift - allows resizing only one edge of the selected region
  • Option - resize the selected region with its center as the anchor point

Are you confused yet? There’s lot’s of power there but it’s not exactly easy to remember which command does what, right? And it’s probably a bit more confusing for those of us using PC-style keyboards.

Fortunately there are options for those of us no good at memorization! I’ll just mention three here:

Grab preferences

Grab comes with the Mac, but a lot of people may never find it because it’s tucked away, buried in the Applications | Utilities menu. Click on it, and it puts an icon down on the dock, but nothing else obvious happens. The way you use it is that you click on the dock icon, then go up to the top menu bar and use the Grab | Preferences menu to select your preferred pointer type, and whether to enable sound.

Grab capture menu

But the real action in Grab is at the Capture menu item, which lets you perform four types of captures, as shown at the right.

Each of the menu options opens a small window that lets you do a capture of the type indicated. One thing it won’t do is capture its own windows, which means I can’t show you screenshots of the actual windows, but if you play around with it a bit you’ll get the hang of it. One bit of weirdness is that it doesn’t actually offer to save the capture to a file until you try to close the window, but the thing that makes Grab less than useful is that the images are saved in .tiff format, which means you’ll probably have to use Preview (or another graphics program) to convert the image to a more useable format, such as PNG. On the other hand, Grab does offer the option to take a screen capture with a ten second delay, which could come in handy at times.

Fortunately there are other options available. We happen to like iScreenshot, which simply pops up a small window giving you a shortcut to the same functionality as Command-Shift-4 (with or without the spacebar modifier):

iScreenshot

The only drawback of iScreenshot is that it closes itself after each use, so you have to re-run it each time you want to take a screenshot. Still, for one-off screen captures when you can’t remember the doggone keystroke combination, this gives you access to the two most commonly used types.

But, we like software with more power, and free! So in that spirit we present GrabberRaster. According to the author’s site, “GrabberRaster allows you to take repeated screen grabs/captures from almost anything that appears on your Macintosh screen. Grab, resize, and save all in one easy step.”

 

GrabberRaster screenshot

 

The instructions for using GrabberRaster are simple:

GrabberRaster is very easy to use.

  1. Open GrabberRaster
  2. Click the Dots to resize the Grabber.
  3. Click the border or use the arrow keys to move the Grabber.
  4. See something you like, click Grab. You can also copy frames to the Pasteboard.
  5. Default format is JPEG, but you can choose another.

NOTE: At this time, GrabberRaster works only with your primary display (where your Menubar lives)

We found a couple of situations where GrabberRaster would let us capture something that the Mac’s built-in screen grabber would not, such as when trying to capture how a screen looks while holding down a certain key.

Another interesting free program is SnapNDrag, which allows you to take a screenshot by just clicking a button and dragging the resulting screenshot off.

SnapNDrag screenshot

The SnapNDrag web site explains that to email a screenshot, you would drag the screenshot from SnapNDrag to the Mail application. It is that simple. No hard-to-remember key combinations, no file conversion to deal with, no file dialog boxes to navigate, no temporary files to erase later on. It is able to save files in PNG, TIFF, and JPEG formats.

Our final mention in this category is Timed Screenshot. As the name implies, it will take screenshots every few minutes, so you can see what has happened on the screen over a period of time. As the author’s site explains:

When you launch this application it runs in the background till you kill it on the Terminal or you log out. There is a configuration file (plain text) where you can change some settings like the time interval in seconds, the name of the destination folder (which can be an alias) and the quality of the JPEG compressor in percent.

The files are named e.g. “2003-06-05-21-42-48-0.jpg”. Year, month, day, hour, minute, second and ID of the screen. It should work with multiple screens, but it’s not tested.

The application will quit when you shut down your Mac or you log out. To quit at any time you may need the force quit dialog.

Timed Screenshot seems like the type of program that most folks won’t need, but the few who do need it will find it really useful. However it can also be used for dubious purposes (for example, to see if a significant other is carrying on online cybersex conversations with someone at a distance) so we must point out that some uses of this program might not be legal in your jurisdiction, particularly if the computer you install it on isn’t yours. Don’t break the law!

There are many screen capture programs out there, including some we haven’t mentioned in this article. Our theory is that it’s always good to have more than one tool in your toolbox, in case one doesn’t perform quite as expected.

Related posts


Keyboard hacks (part 2)

Sunday Apr 13, 2008
This entry is part 2 of 2 in the series Keyboard Hacks

In our last post we were exploring the keyboard settings in the International preference panel in the Mac OS X System Preferences. Today we’re going to look in the Keyboard & Mouse preference panel.

Keyboard Preferences


Under the "Keyboard" tab you can change things like Key Repeat Rate and Delay Until Repeat, but you can also change the action of the modifier keys - see the button that says "Modifier Keys?" If all you want to do is, say, swap the operation of the Control and Option (a.k.a. "Windows" on a PC-style keyboard) keys, you can do it here - you should not need to run another piece of software.

Modifier key remapping in keyboard preference panel



But the real action in this preference panel is under the Keyboard Shortcuts tab, where you can change a multitude of settings.

Keyboard shortcuts preference panel


Note that you can actually set up application-specific keyboard shortcuts. Click the + button, select an application you wish to control, enter the exact title of the menu command you want to add in the text field, and then in the last text field you simply depress the key combination you wish to use to invoke that command.

Normally it’s probably not a good idea to change the Mac’s defaults, BUT one exception may be the commands invoked by using the function keys. Sometimes I use iTerm to connect to a remote system that runs Linux, and I don’t want keys like F8, F9 and F10 bringing up Spaces or application windows, because those keys are used in the software I’m running on the remote system. So I either disable the combinations I don’t use, or change them to something like Control+Function Key.

Anyway, if the System Preferences do not give you enough power over the keyboard, there are free programs you can download that will give you many more options. Just be sure you don’t install both of them at the same time on the same Mac (more in that in a moment).

One rather popular program of this type is called DoubleCommand - as you can see from the screenshot below, it allows you to do several types of keyboard modification.  It actually adds a new preference pane under System Preferences and by checking the appropriate boxes you can select any of the modifications shown.

DoubleCommand preference panel


However, our preference in this type of program is KeyRemap4MacBook, which we find to be far more versatile than DoubleCommand - and despite what the title may imply, it should run on any Mac using OS X (it has been confirmed to run on the MacBook, MacBook Pro, and Mac Mini).

KeyboardRemap4MacBook preference panel


Those of you that have recently switched from Windows (or who are simply more used to Windows-style keyboards) will want to pay special attention to the settings under the "For PC User" section.

KeyboardRemap4MacBook has far more available key mappings than DoubleCommand (there is a list of supported remappings on their web site), but this is a case where you should choose the program that best does what you want it to do. We will note that if you are using a PC-style keyboard and like to use the directional keys on the numeric keypad (rather than the numbers) then KeyboardRemap4MacBook is definitely the one you want.

Before we close we must give you one warning, based on experience: NEVER INSTALL BOTH DOUBLECOMMAND AND KEYREMAP4MACBOOK ON THE SAME SYSTEM!!! These two pieces of software both try to use the same "hooks" into the system and if you install both, neither will work, and more than likely your keyboard will stop working. And now you are really in a pickle, because in order to uninstall the one you don’t want, you’ll be asked to enter your password - which you can’t type in because the keyboard doesn’t work! Furthermore, even a power-down reboot will not help as long as both programs are installed. Remember our discussion of the Keyboard Viewer in part 1? That’s the only way we know of that you’ll be able to enter your password in order to uninstall one of the two programs (by clicking on the Keyboard Viewer keys with your mouse). So don’t get yourself into this mess in the first place - install only ONE of the two programs, and if you want to try the other, completely uninstall the first one before you install the second.

Related posts


Keyboard hacks (part 1)

Saturday Apr 12, 2008
This entry is part 1 of 2 in the series Keyboard Hacks

One thing that seems to be a matter of personal preference for many people is the way in which the keyboard operates. Not only do you want to be able to easily type your native language, but you may want certain keys to do certain things.

Apple decided to be different by coming out with their own keyboards, which have a slightly different key layout than the typical PC keyboard. Nevertheless it is quite possible to use a standard PC keyboard with a Mac provided you can get the hardware part right - for example, if you want to use one of those keyboards you got free after rebate a few years ago (that is still collecting dust in your closet) and you own a Mac Mini, you’ll probably need a PS2 to USB adapter. These are often available as a relatively inexpensive item on eBay - some of them will only convert a keyboard, but for only a small amount more you may find ones that will convert a keyboard and a mouse.

Whether you have a genuine Apple keyboard or a PC keyboard that has been pressed into service, you might wish that certain keys behaved differently. So, here’s a brief roundup of the most common ways to modify keyboard behavior.

First, to switch languages, go to System Preferences, International and then click on the Input Menu tab. There you can select among many different keyboard layouts, input methods, and palettes. If you are a native English speaker than probably all you want to do is make sure the correct country is selected for the keyboard input type, but it’s nice to know that the other options are available in case you ever decide to learn another language, or host a visitor that speaks another tongue.

System Preferences - International


But there’s another reason you might want to go to this particular preference pane. At the bottom there is a checkbox labeled “Show input menu in menu bar.” If this is checked, it shows a small national flag or symbol in the menu bar, representing the currently selected keyboard layout. It’s automatically selected if you select two or more different keyboard layouts, because this is what gives you the ability to change keyboard layouts easily from the menu bar - so you can, for example, change from English to Canadian English with a couple of mouse clicks. Yes, I am confused also - I thought that Canadian English was the same as American English except for a few minor spelling variations. Maybe when you press the letter “a”, it prints the character string “eh?” (Sorry, bad joke - I really have no idea what the difference is!).

If you keep “Show input menu in menu bar” checked, even if you only have one language selected, it will give you ready access to the Keyboard Viewer.

Keyboard Viewer


And what is the Keyboard Viewer, I hear you ask? Well, it has a couple of functions. For one thing, it shows a real Apple keyboard layout and when you press a key on your keyboard, it shows you what key it thinks was pressed on the Apple keyboard layout. This can help you learn the differences between your PC keyboard and the Apple layout, and it can also show you some interesting options (for example, try holding down the ALT key (if you have a PC-style keyboard) or the Option key (if you have a genuine Apple keyboard) and you’ll see an entire selection of extra symbols that can be entered. Want to say you have something on sale for 99¢, or that you need a 600Ω resistor, or that something you’ve written is ©2008? Those special symbols and many more are available by holding down the ALT key or Option key.

Keyboard Viewer with ALT/cloverleaf key depressed


And, you can try other combinations of modifier keys for even more symbols (try SHIFT+ALT or SHIFT+Option, for example).

Also, you can click on the Keyboard Viewer with the mouse to directly enter keystrokes. This can be a lifesaver if you ever find yourself in a situation where the keyboard is non-responsive and you really need to enter a few characters. Not only can you enter regular keystrokes, but you can use the dropdown to change the font mapping to “Webdings”, or any of three sets of “Wingdings.”

But, maybe you want even more power over your keyboard. We’ll cover that in Part 2. Stay tuned…

Related posts