Assigning a shortcut to open Safari's current page in Google is simple but breaks frequently, because the menu item name includes Chrome's version number. The simple fix is to use an Apple Script like Mike Hardy's as a proxy to Google Chrome. I'm describing this in more detail in this blog post, which is also reproduced below.
Currently shipping Macs come without Adobe Flash Player preinstalled, and I’ve been running that same setup without Flash for quite a while now myself. More and more webpages work fine without Flash and only the occasional video requires it. When that is the case, I simply go to the Develop menu (enable it in Safari's Advanced preferences if you don’t have it) and select Open Page With > Google Chrome.app (20.0.1132.21). Since Google Chrome comes with Flash preinstalled, this is a simple way to switch to a Flash-enabled browser.
Now, rather than choosing Chrome from the menu it would be nice to assign a keyboard shortcut for this menu item, and this is actually quite simple: Open the keyboard preference pane in System Preferences, select ‘Application Shortcuts’ and add a shortcut for the Google Chrome.app (20.0.1132.21) menu item to Safari. However, the problem here is that the menu item contains the version number of Chrome and since Chrome updates frequently (and in the background), you’ll find yourself with a broken shortcut very soon.
The fix for this is a little Apple Script OpenURLInNewChromeWindow.app by Mike Hardy which tells Google Chrome to open the URL via an Apple Script command. If you run this script once, it will register itself as a application that can handle URLs, and will therefore also appear in the list of browsers under Open Page With. Opening a page with this script will open the current page in Chrome just like before, but the menu item will stay the same no matter which version of Chrome you have installed. You simply assign the shortcut to this "browser" instead of the ever-changing Chrome.
As an added benefit (and actually the reason Mike Hardy wrote the script in the first place) is that the page opens in a new window and not in a new tab (which can be quite annoying when using virtual screens). See Mike’s blog post for more details how to use his script in that context.
In a comment to a recent hint about using the Shift and Option keys to make finer adjustments to the volume of your Mac, user monolithic pointed out that these modifier keys also work with the brightness controls, F1 and F2. I didn't know that, and it looks like there's no hint for it on the site.
So, to change the brightness just a bit, press Shift and Option, then press either F1 to lower the brightness, or F2 to increase it. Personally, I find this more useful than the volume controls, as I often would like to change by display's brightness by a half-step.
This works in 10.7.4; if it works in other versions of Mac OS X, feel free to specify this in the comments.
A recent hint gave instructions for enabling and disabling rubber band scrolling in Mac OS X Lion, using a Terminal command. This hint contains an Applescript to do the same, without having to use Terminal.
Compile this script in Applescript Editor and run it. It will let you enable or disable rubber band scrolling.
display dialog "Disable or enable rubber banding?" buttons {"Enable", "Disable", "Cancel"} default button "Cancel" with title "Rubber Band Control" giving up after 15
if button returned of the result is "Disable" then
do shell script "defaults write -g NSScrollViewRubberbanding -int 0"
else if button returned of the result is "Enable" then
do shell script "defaults delete -g NSScrollViewRubberbanding"
end if
[kirkmc adds: Well, it seems that disabling rubber band scrolling is quite popular! After a first hint, then yesterday's hint about disabling rubber band scrolling in iTunes, here's another, perhaps easier way, using AppleScript.]
A recent hint described how to disable elastic scrolling in many Lion applications. You can disable this effect in iTunes alone by setting the hidden preference "disable-elastic-scrolling".
To turn off elastic scrolling in iTunes, enter this in Terminal:
[kirkmc adds: I find it interesting that this key uses the term "elastic" and the one in the previous hint uses "Rubberbanding." Which means that I had to make the title of this hint include both...]
To add text to the login window in Lion, there's no need anymore to use a system utility or to manually edit a plist file, as it was the case in earlier versions of Mac OS X. This can be useful to display an "If found" message.
Go to the Security & Privacy preference pane of System Preferences. Under the General tab, check the second box, "Show a message when the screen is locked," and then edit the message using the "Set Lock Message..." button.
This message displays near the bottom of the Login window or the lock screen. You can make multiple paragraphs by pressing Option-Return to go to a new line.
[kirkmc adds: This was indeed covered several times in the past, and required futzing around with .plist files. There were hints in 2002, 2005 and 2011. This method is much simpler, and deserves a mention.]
The ability to modify the volume in smaller increments was previously available in earlier versions of OS X. Holding down Shift and Option before pressing the Volume keys on your keyboard would let you adjust the volume in quarter-steps. This ability was absent in OS X 10.7, but has returned in 10.7.4. This is not mentioned in the release notes.
[kirkmc adds: Well, I've never used this, so I'm not sure whether it was indeed missing. If anyone has a pre-10.7.4 version of Lion running, can you test it? (I have one in a virtual machine, but changing the volume from the keyboard doesn't affect VMs.) This feature first appeared in 10.5.]
I had some swapping issues the other day on my Mac mini, so I went into /var/vm to check how many files were there. I was surprised to find a sleepimage file; this is a file that is written when a Mac goes into hibernation mode. This file was about 9 GB - or the size of my RAM (8 GB) plus a bit.
Hibernation is only supposed to be used on laptops, but in an informal query of acquaintances (read: Twitter followers), I found that several people had seen this issue after the 10.7.4 upgrade. In addition to the space used, hibernation mode means the Mac takes a lot longer to go to sleep.
This hint from 2006 shows how to turn off hibernation and save that disk space. Essentially, you run the following command:
sudo pmset -a hibernatemode 0
(I didn't run the second command, and it doesn't seem to be needed.)
So, if you've found that your desktop Mac has lost a lot of disk space, check in /var/vm.
You can also check which mode your Mac is in by running this command:
pmset -g | grep hibernatemode
If the result is 0, then you're in normal sleep mode. See man pmset for more information about the different sleep modes.
In honor of the "sandboxalypse," or the day that Apple started imposing sandboxing rules on the Mac App Store, I thought it would be interesting to see how Mac OS X Hints readers use the Mac App Store. Head over to our new poll about the Mac App Store and software purchases.
I got sick of running my cursor up to the top of the screen to see my battery life, the time, etc., and I realized that there is a simple way to display the menu bar when in full screen mode. Just invoke the Spotlight keyboard shortcut, which by default is Command-Space. Use that key combination once to show the menu bar, then again to hide it.
[kirkmc adds: Nice. I don't really get full screen mode, but the times I have used it, I've been confronted with that problem, especially wanting to see the time.]
Back in the day, prior to Leopard, there was a console.log file, which contains errors and messages for the current user's account. When Leopard came around, this file was removed, and the system-wide logging system (ASL) replaced it. Those messages are still recorded, but when you view logs in Console, you can't see them on their own.
I was doing some research today for an article, and wondered where that file went, and how one could view it, since the full system.log contains so many entries that it can be hard to wade through. I found a forum thread from 2008 which explains that you can see what used to be in console.log by running syslog -C in Terminal. You can also run this command to save these entries in a file, then view them in vim: syslog -C > /tmp/console.log; view /tmp/console.log. Or, if you simply want to save this information in a text file, you can do this: syslog -C > /Desktop/console.log.
While this isn't new, it's good to know, if you're looking through logs in Console in search of information.