Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Schedule "Do Not Disturb" for Notification Center System 10.8
If you like Notification Center, in Mountain Lion, you may also like its "Do Not Disturb," feature, where you can turn off notifications if you're busy and they get to be a bother. There are a couple of ways you can do this: you can Option-click the Notification Center menu bar icon, or you can scroll down when Notification Center is visible, and toggle the slider to OFF.

On iOS, you can schedule this action, but not on OS X. Ben Waldie, writing at TUAW, posted an interesting AppleScript/Automator solution to this. You can create an Automator workflow, and set it to run in Calendar, so you can have the Do Not Disturb feature turned on and off at specific times. It's a bit ham-fisted, to be sure; it uses a defaults write or defaults delete command, then a killall NotificationCenter command, which is essentially force-quitting Notification Center and allowing it to relaunch. The problem is that if anything goes amiss, Notification Center might not relaunch.

It's too bad that there's no built-in way to do this. But this is a good solution for now, if you really want to turn Notification Center off and on at specific times.
  Post a comment  •  Comments (1)  
  • Currently 2.50 / 5
  You rated: 1 / 5 (6 votes cast)
[5,494 views]  View Printable Version
Create playlists in iTunes for all complete albums Apps
User Aphex5 posted an interesting question on Stack Exchange, asking if there was a way to create playlists for all complete albums in his iTunes library. He then followed up with an answer, the following AppleScript:
-- Creates a playlist for each full album you have in iTunes
-- Set the playlistPrefix and playlistSuffix as desired before running

-- Based on code by Brad Campbell

tell application "iTunes"
    set playlistPrefix to "FA: "
    set playlistSuffix to ""
    -- The "FA: " prefix will help cluster full albums in iTunes' playlists,
    -- and is narrow enough to not get in your way when viewing on an iPhone

    set albumBuckets to {} as list
    set allSongs to (every track of library playlist 1 whose enabled is true and podcast is false and kind contains "audio") as list

    -- Find all partial albums in iTunes
    repeat with currentTrack in allSongs
        set albumName to album of currentTrack as text
        set artistName to artist of currentTrack as text

        -- First check for missing values, then perform integer comparison
        -- Zero is on the left to force interger type coercion, just in case
        if album of currentTrack is not missing value and 0 is less than length of albumName then
            if artist of currentTrack is not missing value and 0 is less than length of artistName then
                if track number of currentTrack is not missing value and 0 is less than track number of currentTrack then
                    if track count of currentTrack is not missing value and 0 is less than track count of currentTrack then
                        if albumBuckets does not contain album of currentTrack then
                            copy album of currentTrack to the end of albumBuckets
                        end if
                    end if
                end if
            end if
        end if

    end repeat

    repeat with currentAlbum in albumBuckets
        set albumSongs to (every track of library playlist 1 whose album is currentAlbum)
        set firstTrack to first item of albumSongs

        -- Filter album list to act only on full albums
        if (count of albumSongs) is equal to track count of first item of albumSongs and 1 is less than (count of albumSongs) then
            -- This is a full album, construct the playlist

            -- Sort tracks by track number
            set albumSongsSorted to {} as list
            repeat with i from 1 to (count of albumSongs)
                repeat with trk in albumSongs
                    if track number of trk is i then
                        set nextSong to trk
                        copy nextSong to the end of albumSongsSorted
                    end if
                end repeat
            end repeat

            -- Don't show artist name for compilations
            if firstTrack is not compilation then
                set playlistNameArtist to artist of firstTrack & " - "
                set playlistNameArtist to ""
            end if

            set albumPlaylistName to playlistPrefix & playlistNameArtist & currentAlbum & playlistSuffix

            -- Create playlist
            if user playlist albumPlaylistName exists then
                    delete tracks of user playlist albumPlaylistName
                end try
                make new user playlist with properties {name:albumPlaylistName}
            end if

                repeat with trk in albumSongsSorted
                    duplicate trk to user playlist albumPlaylistName
                end repeat
            end try
        end if
    end repeat

    display dialog "Playlists created! Check iTunes for playlists beginning with '" & playlistPrefix & "'"
end tell
This will traverse the iTunes library and make playlists for every album where the number of tracks matches the total number of tracks for the album; in other words, if you only have one or six songs from a ten-song album, it won't make a playlist. Naturally, this assumes that you have the correct metadata for your tracks to enable this. If you don't, you can go through your albums - one by one, alas - using Doug Adams' Albumize Selection AppleScript; this script sets both track number and track count tags to the appropriate numbers.
  Post a comment  •  Comments (5)  
  • Currently 3.13 / 5
  You rated: 1 / 5 (8 votes cast)
[5,993 views]  View Printable Version
Have Spotlight results show Dictionary words just below Top Hit (or anywhere you want) System
If you use Spotlight to look up Dictionary definitions, you may find it annoying that they show up near the bottom of the list. While you can change the order of most Spotlight categories from the Search Results tab of the Spotlight pane in System Preferences, Dictionary isn't in that list.

However, there is a hack, involving some simple editing of the ~/Library/Preferences/ file. A recent post on Stack Exchange explains what to do. You open the file with Xcode, then add a Dictionary item, which will allow you to move the Dictionary category to where you want in the Spotlight results. See the post linked above for full details, or see this blog post in Chinese explaining the procedure.
  Post a comment  •  Comments (3)  
  • Currently 2.63 / 5
  You rated: 1 / 5 (8 votes cast)
[5,907 views]  View Printable Version
Create default printer presets for multiple users Printers
I was tasked with setting up a company's new printers and had to struggle with creating a default set presets that also used a PIN number login for accounting. This needed to be pushed out to the current user base, in real time, and without interrupting anyone's ability to print. Here's how I did it.


  • CUPS server web interface to set the printer defaults
  • ARD to install the drivers
  • lpadmin to add the printer (We're using LPD on a Windows 2008 R2 server)
  • ARD to copy the cups PPDs

1. Create the default settings:

In Terminal, run this command: sudo cupsctl WebInterface=yes
In a web browser, go to: http://localhost:631/admin

2. Install the drivers (.pkg files via ARD)

3. Add the printer using lpadmin:

lpadmin -p SweetNewPrinter-7535-clr -L "Department" -E -v lpd://WindowsServer/SweetNewPrinter-7535-clr -P /Library/Printers/PPDs/Contents/Resources/Xerox\ WC\ 7535.gz -o printer-is-shared=false

4. Copy the default cups PPDs via ARD (set permissions to: root:_lp):


It took about an hour to set this up for 200 end users, with no scripting required.

  Post a comment  •  Comments (9)  
  • Currently 3.25 / 5
  You rated: 1 / 5 (4 votes cast)
[9,019 views]  View Printable Version
Configure OS X Server's caching server OS X Server
A new feature in the latest update to OS X Server is a caching server. This is designed to cache files in setups with multiple users so files only need to be downloaded once from the internet (or from the Mac App Store, iTunes Store, etc.). Files are cached locally, so users can save time getting downloads.

Apple has published a technical note explaining how to configure the caching server. You can set a limit to the amount of disk space used for the cache, you can choose a location for the cache, set the number of concurrent clients accessing it and much more.

This looks like a valuable feature for any organization running OS X Server.
  Post a comment  •  Comments (7)  
  • Currently 1.96 / 5
  You rated: 1 / 5 (25 votes cast)
[15,601 views]  View Printable Version
Recover from File : /// crash loop in OS X Messages System 10.8
This recently published "File : / / /" bug (see this Macworld article for an explanation) is a huge problem and can be seriously exploited to crash Mac apps, especially Messages. If someone sends you an iMessage (from an iOS device to Messages for Mac), Messages will continually crash, rendering it completely useless.

This is a Warning - please DO NOT SEND a message with that content over iMessage. I do not suggest you test this bug. However, despite these warnings, trolling people will still send it to crash their friend's message machines.

Below are three fixes to make iMessage workable again: FIRST (and easiest): Send 30-40 (lines of) iMessages back to the sender. The idea here is to lengthen the iMessage log so that the File : / / / message is not loaded when Messages starts up. You can either send these from an iOS device or from a Share button, such as the one in Safari. Continue trying until you can open iMessage again. Then, delete the conversation with Command+Delete.

SECOND: Remove the "chat.db" message database from ~/Library/Messages. This will remove all Messages conversations.

THIRD: Edit "chat.db" to delete the offending message. You will need to do this with an sqlite editor not subject to the crash (most that I tried do not crash). The message will be found in the "messages" table.

[kirkmc adds: This is, indeed, a serious bug, and it's quite simple to send a denial of service attack to someone using Messages. As the poster said, do not try this juts for fun. You may want to try it in other apps just to see that the crash does, indeed, occur, but at your risk and peril. It's really quite surprising that a bug of this nature got through Apple's QA...]
  Post a comment  •  Comments (6)  
  • Currently 3.00 / 5
  You rated: 1 / 5 (9 votes cast)
[7,065 views]  View Printable Version
Bookmarklet to send webpage URL to iOS Gmail app iOS devices
If you want to send an email via the Gmail iOS app containing the URL and title of a web page, you can't simply use the Share button. But you can use a bookmarklet, as posted by Federico Viticci on MacStories. Save the following bookmarklet in your browser:

Select it from your browser, and it will open the Gmail app, and create a new email with the title of the web page as the subject, and the URL in the body of the message. Note that this may not work if the Gmail app is not paused in the background.
  Post a comment  •  Comments (1)  
  • Currently 3.27 / 5
  You rated: 3 / 5 (11 votes cast)
[8,105 views]  View Printable Version
Change subtitles quickly in DVD Player Apps
I'm affected by a mild form of phonemic deafness: the part of my brain in charge of translating sound into words doesn't work perfectly. Therefore, understanding spoken language is more difficult for me than for the average human, even in my mother tongue (Italian). Nevertheless, I've been always fascinated by languages, and I have learned to read in a few of them.

With the advent of the DVD, movies and TV series in their original language have become available and I'm using them as a mean to improve my comprehension. Usually, I try to understand the dialogues without using subtitles, but sometimes I need to look at them (if possible, in the language of the audio track) for a while. Apple's DVD Player allows me to do so, but you need to issue a series of commands using the controller or the menus to turn them on. However, it is possible to automate this process, causing the video to scrub backwards a little, activate the chosen subtitles and start the playback again.

As a first step, you must create a new service in Automator with a single action: "Run Applescript" (located in "Utilities"). Input the following script:
tell application "DVD Player"
	rewind dvd
	delay 1  -- approximate rewind time in seconds
	pause dvd
	set subtitle to 1 -- to choose first item of available subtitles
	play dvd
end tell
Select the options "Service receives no input" and "in any application". The number after "delay" controls the amount of back-scrubbing; you may try different values to fit your taste, and "set subtitle to 1" enables the first set of available subtitles.

Save the service with an appropriate name and open the Keyboard Shortcuts tab of System Preference's Keyboard pane. Select "Services" in the leftmost section and add a keyboard shortcut that suits you for the newly created service.

You may duplicate the process above, changing "set subtitle to 1" with "set subtitle to 2", etc. to create commands that select other sets of subtitles.

As a last step, create a service with the following AppleScript:
tell application "DVD Player"
 set subtitle to 0
end tell
This will allow you to switch subtitles off.
  Post a comment  •  Comments (0)  
  • Currently 3.14 / 5
  You rated: 1 / 5 (7 votes cast)
[4,410 views]  View Printable Version
Use Bluetooth keyboard with Apple TV Apps
You may have seen the news: the latest update to the Apple TV (2nd generation or later) allows you to use a Bluetooth keyboard. This makes searching for things much easier; the non-keyboard interface is slow and clunky. If you want to use a Bluetooth keyboard with your Apple TV, you can see this Apple technical document which explains how to set up a Bluetooth keyboard with an Apple TV, how to disconnect the keyboard, and how to troubleshoot common problems.
  Post a comment  •  Comments (6)  
  • Currently 2.78 / 5
  You rated: 1 / 5 (9 votes cast)
[10,311 views]  View Printable Version
Use emoji within Safari Web Browsers

Safari displays emoji perfectly: on web pages, in tabs, and in the titlebar (if emoji are used in a page title). This makes it unique amongst the main OS X browsers: Firefox displays them in the title bar but not in tabs or on the page, while Chrome displays them in tabs but not on the page. There's a screenshot on my blog where I discuss this in more detail (the blog posting is an example that can be used to test browsers).

I played around a little with encoding settings in Firefox and Chrome but couldn't fix it. Maybe others will have more luck.

One issue I'm not clear about is what's required on the web backend to display emoji. UTF-16 encoding? Does anyone know?

[kirkmc adds: It even works here, with Geeklog. 😄]
  Post a comment  •  Comments (3)  
  • Currently 1.90 / 5
  You rated: 2 / 5 (20 votes cast)
[8,396 views]  View Printable Version