Nieuws door: MacOSX Hints

How to hide all .plist.lockfile files

18/05/2012 04:30pmApple has introduced an additional type of preference file in Lion, those whose names end in ".plist.lockfile". Here is a good explanation of the function of those files:Lockfiles and other plist file subtypes in OS X Lion

Since plist.lockfiles do not contain any useful information for the user and almost double the content of and clutter the Preferences folders in /Library and ~/Library, I've been looking for a way to hide those files. With help from Yvan Koenig of MacScripterin this topic (I'm flex20 in that forum), I wrote an AppleScript "Hide Unhide plist.lockfile.scpt," which provides a quick and easy way of hiding or unhiding all those pesky files.

You will need an admin password to run the script because some of the ".plist.lockfile" files can only be changed by admi ...

"Portable" TextWrangler with Dropbox

18/05/2012 04:30pmI love TextWrangler, and I have a Mac at work and one at home, but often do coding on both. I set up a system using Dropbox so both my preferences and my Application Support files sync so I always have my stationery files and the same settings, wherever I am.

Run the following as a shell script on each of the Macs. This will copy TextWrangler to your Dropbox folder, and create the support folder on Dropbox, then create a symlink to it in the correct location on your Macs. It will then copy the preference files to Dropbox, so when you launch the application on either Mac, you'll have the same setup.
#!/bin/bash#+ Portable TextWrangler#* Formatted date & time string.FORMATTED_DATE=`/bin/date "+%Y-%m-%d%H%M%S"`#+ ...

Permanently Unhide Library

18/05/2012 04:30pmWhen Apple shipped Mac OS X Lion 10.7, the “Library” folder located within every user’s home folder, which had previously been visible to users in the Finder, was made invisible. This hint shows how to make the folder visible and keep it that way forever.

As you may know, and as mentioned in this hint, the Library folder can be made visible again by running the following command in Terminal:

/usr/bin/chflags nohidden ~/Library

Apple keeps making the folder invisible again with every System update, so it gets tedious re-running the above script. You can automate this by adding a Login Item with an AppleScript "script application" containing the following code:

do shell script "/usr/bin/chflags nohidden ~/Library"

Read detailed instructions for this hint, and download a ready-made script application file on the ...



New poll: Does your main Mac have an SSD?

18/05/2012 04:30pmAs SSDs become more common, and prices drop, more and more people are either buying Macs with SSDs, or installing them in their Macs. Personally, I started using an SSD with the first MacBook Air in 2008, and bought my current Mac - a Mac mini, purchased in 2011 - with an SSD. The gains in performance are huge, though the price still makes them a choice that is not for everyone.

So, what about you? Does your main Mac - the one you use most - have an SSD? Feel free to post in the comments to the poll which model, whether you bought it with the Mac or installed it yourself, or any other comments you may have about SSDs.

Vote in the poll


The first is an improved version of the original AppleScript which presents a dialog box from which a selection of local volumes to be ejected can be made. An example of its usefulness might be that it provides a reliable method for quickly ejecting a MacBook's mounted local volumes for users on the go. I've configured it as a "Run AppleScript" step for an Automator-based Mac OS X Service called "Unmounter" and assigned it the keyboard shortcut of (Command-Control-Shift-E) in System Preferences on my system.

The second is a more robust version of the AppleScript included in my first reply to the original hint topic. It attempts to automatically unmount all unmountable local volumes, and if it finds none, attempts to mo ...

Copy partially played Audiobooks to a playlist

18/05/2012 04:30pmiTunes Smart Playlists don't offer a criteria to find tracks which have been partially played. While "Last Skipped" is an option, this track property may not be set if the track wasn't actually skipped and was merely stopped.

However, if a track's "Remember playback position" option is set (and most audiobooks have this set by default) the track's AppleScript bookmark property will contain the number of seconds that a track has advanced before being stopped. Thus, any track with a bookmark value greater than zero would have been partially played.

Here is an AppleScript that will copy all the tracks in the "Books" library to a new playlist named "Partially Played". Each time it is run it will update the "Partially Played" playlist.
property nameOfPlaylist : "Partially Played"tell application "iTunes"	try		set thePlaylist to some playlist whose name is nameOfPlaylist	on error		set thePlaylist to (make playlist with properties {nam ...

Open certain preference panes with quick shortcut

18/05/2012 04:30pmIf you press the Option key, then press certain dedicated keys on the standard Apple keyboard, preference panes will open. This works for Mission Control (Option-F3 or Option-F4), Displays (Option-F1 or Option-F2), and Sound (Option-F10, Option-F11 or Option-F12). The F keys in question are those which act on the given features, either displaying Dashboard or Mission Control (F3 and F4), decreasing or increasing brightness (F1 and F2), or changing or muting volume (F10, F11 and F12). If you use a laptop, you may need to press the Fn key together with the other keys to open these preference panes.


Add to digg
Click on an icon in the Downloads popup and drag it to any folder, or even onto a Dock icon to launch a file you've just downloaded with a specific application.

[kirkmc adds: This seems obvious, but there's no hint here for it. There have been hints about
double-clicking an icon in the Downloads window to open it, copying and pasting URLs from the Downloads window, and the keyboard shortcut to show the Downloads popup (Command-Option-L).]


Open Terminal's preferences.

Go to Settings, then Shell. You can choose here to run a command at startup. You could create a simple log of your session using the following:
/usr/bin/script ~/Desktop/Terminal.log
This will log everything you do and append it to the log file.

I like to keep my history so instead I wrote this small script that archives previous sessions by renaming the file with a date/time string. I then set Terminal.app to run at startup the following command:
~/Desktop/logger.sh
Here's the script:
#!/bin/bash# logger.sh# Log everything you do in Terminal.#* Formatted date & time string.FORMATTED_DATE=`/bin/date "+%Y-%m-%d%H%M%S"`#* Archive the previous file/bin/cp -f ~/Desktop/Terminal ...

Remove rubber band scrolling in most apps

18/05/2012 04:30pmCombining some findings from a recent hint and on Apple's forums, I've finally found a way to disable the annoying rubber-band scrolling in most applications. All the credit goes to those guys as they did the initial investigation.

It works in applications like:
  • Finder
  • Mail
  • Preview
  • TextEdit
  • Xcode
and probably in most applications that use the standard UI (the string to be used in defaults appears in AppKit.framework). It doesn't work in Safari or iTunes.

In Terminal type:
defaults write -g NSScrollViewRubberbanding -int 0
It should work after you relaunch your applications.

To undo this change, run this command in Terminal:
defaults delete -g NSScrollViewRubberbanding
[kirkmc adds: Works as described. I haven't tested many apps, so feel free to post which o ...

View full track info in iOS Music App

18/05/2012 04:30pmThis hint solves a long standing problem when playing classical music on an iPhone. When using the iPhone Music app (iOS 5.1), the full entry (e.g. name of artist, album or song title) for an item can be too long to be displayed. Tap and hold entry to see the full entry pop up. Tap and drag your finger down the list to make the pop up change as you drag. This works for album titles, song titles, and artists names.

[kirkmc adds: Nice. I hadn't heard of this before, but searching the web shows that it is not totally unknown. Since it hasn't shown up here before, it's worth posting.]

Add to diggAdd to digg
Copy
this Xcode plugin to the following directory:

~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/

You should create the directories if needed.

Enjoy!

Add to digg

XCode for Lion can convert the file to a regular XML text file:

  1. Open the file in Xcode.
  2. Choose File > Duplicate.
  3. In the Save dialog box, select "Property List XML" from the Format drop-down list.

Moving the regular text version over to Lion and putting it into the Preferences folder gave us a way to copy a huge list of custom paper sizes from one designer to another quickly and easily.





Option-up arrow and Option-down arrow cycle through sent messages in iChat

18/05/2012 04:30pmWhen focus is in the text entry field in an iChat chat window, holding option and using your up and down arrow keys cycles through the previous messages you've sent. This is very similar to how Terminal lets you cycle through previous command just using the up and down arrow keys.

[kirkmc adds: I actually spotted this a while ago. I'm not sure why it's there; and I don't really see any use for it, other than, perhaps, to find a text you sent to someone without scrolling in the window, and then copy it to send to someone else. This works in Lion; can anyone confirm that whether works in earlier versions of OS X or not?]

Add ...<br /><br /></td></tr></table><!-- HTML generated from an RSS Feed by rss2html.php, http://www.FeedForAll.com/ a NotePage, Inc. product (http://www.notepage.com/) --><h1><a href="http://feeds.macosxhints.com/click.phdo?i=5225499536549ada3998b7571f747e8f" target="new">Build a service to count characters, words and paragraphs</a></h1><table border="0" style="margin-left:-3px;"><tr><td valign="top" width="150" class="date-time-item">18/05/2012 04:30pm</td><td width="10"></td><td valign="top" style="text-align:justify;">Apple does not provide any way to count the number of characters in a selected text. Fortunately, you can create your own very easily using Automator.<br><br> Launch Automator and create a new Service. Add the Run AppleScript script action, then paste the following code:<div style="margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:700px; height:200px; overflow:scroll;white-space:nowrap;resize:both"><pre>on run {input, parameters}	try		set MyText to input as string		set NombreSignes to the number of characters of MyText		set NombreMots to the number of words of MyText		set NombrePara to the number of paragraphs of MyText		set LeResultat to "The selected text contains :" & return & "- " & NombreSignes & " sign(s) ;" & return & "- " & NombreMots & " word(s) ;" & return & "- " & NombrePara & " paragraph(s)."		display dialog LeResultat buttons {"OK"} default button 1 with icon note	on ...<br /><br /></td></tr></table><!-- HTML generated from an RSS Feed by rss2html.php, http://www.FeedForAll.com/ a NotePage, Inc. product (http://www.notepage.com/) --><h1><a href="http://feeds.macosxhints.com/click.phdo?i=71bc66cdea91a5461d2a4eaeb0097432" target="new">Use Logitech N305 number pad with Mac</a></h1><table border="0" style="margin-left:-3px;"><tr><td valign="top" width="150" class="date-time-item">18/05/2012 04:30pm</td><td width="10"></td><td valign="top" style="text-align:justify;">My right shoulder had been hurting lately, due to the movement necessary to reach my trackpad. I was using a standard, wired Apple keyboard with the number pad on the right, and my Magic Trackpad was to the right of that, making me reach pretty far to access it. <br><br> So, I set out in search of a standalone number pad I could use with my Mac. While I don
But the N305 does not support Macs. Fortunately, in reviews for the product on Amazon, a number of people posted a solution. Download the free
KeyRemap4MacBook, a preference p ...

Reduce the size of Google Chrome

18/05/2012 04:30pm]Google Chrome keeps older versions of its web browser causing it to balloon in size. I noticed that the Google Chrome App on my Mac was 1.2 GB. That seemed a bit portly for a web browser. Upon looking into the app's bundle, by right-clicking and choosing Show Package Contents, I found multiple old versions of the app, all which appeared to be nearly identical. I removed all but the most recent version and everything appears to run correctly and the app size is now a much more slim 113 MB.

[kirkmc adds: Interesting. On my Mac, in the bundle, in Contents > Versions, there are, indeed, two versions of Chrome. This presumably has something to do with Chrome's silent updating. (Queries on Twitter suggest that this is the norm; a number of people replied that theirs was around 220 MB, as was mine.) Make sure you keep the one with the highest version number. You could also, of course, just download a new copy.

If you want to turn off this automatic updating, s ...