Play Otvoreni Radio – version 2.2

April 13th, 2010 No comments

Yet again another version of Play Otvoreni Radio. I changed some bulky, redundant steps and fixed a little “bug”: after the playback starts, the Otvoreni Radio playlist wasn’t always selected. So, if I presses play on the remote after I paused the radio, iTunes started to play the last selected playlist – which mostly wasn’t the right one.

Downloads:
Play Otvoreni Radio Application V2.2Otvoreni Radio

Play Otvoreni Radio Script V2.2 (PDF version)

Play Otvoreni Radio Script V2.2 (.scpt version)

What is this script doing?

1. Variables

First it sets a series of variables. In my case I used all known URLs of Otvoreni Radio. Additional I created a variable with the playlist name (which is frequently used) and made a list which includes all the URLs.

global myPlaylistName — set the name of the playlist
  1. set myPlaylistName to "Otvoreni Radio"
  2.  
  3. global myUrl01 – set the URl for the 1st track
  4. set myUrl01 to "http://tv29.stream-music.net:8200/"
  5.  
  6. global myUrl02 – set the URl for the 2nd track
  7. set myUrl02 to "http://tv27.stream-music.net:8100/"
  8.  
  9. global myUrl03 – set the URl for the 3rd track
  10. set myUrl03 to "http://82.193.201.234:8001/"
  11.  
  12. global myUrl04 – set the URl for the 4th track
  13. set myUrl04 to "http://213.147.125.75:8003/"
  14.  
  15. global myVolume – set your desired volume (default is 50%)
  16. set myVolume to 50
  17.  
  18. global enableMyEQ – decide if the EQ will be enabled
  19. set enableMyEQ to true
  20.  
  21. global myURLs
  22. set listOfUrls to {myUrl01, myUrl02, myUrl03, myUrl04} –creates a list of URLS

2. Functions

Here are functions which will execute our desired operation.

startPlayBackOfPlayList()
This simply starts the playback of the mentioned playlist. It also sets the EQ and the volume. And, of course, it tells iTunes to focus on the playlist.

on startPlayBackOfPlayList() — starts the playback of your playlist
  1.  try
  2.   tell application "iTunes"
  3.    set sound volume to myVolume
  4.    set EQ enabled to enableMyEQ
  5.    play user playlist myPlaylistName –this plays the first track of playlist
  6.    set view of front browser window to user playlist myPlaylistName –sets focus
  7.   end tell
  8.  on error
  9.   errorCouldNotPlay() – display error and offer a retry
  10.  end try
  11. end startPlayBackOfPlayList

checkIfPlayListExists()
If the playlist already exists, the script should skip the playlist creation. From the second start on, it will proceed much faster.

on checkIfPlayListExists() — checks if your playlist exists
  1.  set checkList to myPlaylistName
  2.  tell application "iTunes"
  3.   exists user playlist checkList
  4.  end tell
  5. end checkIfPlayListExists

createMyPlaylist()
Pretty obvious, this created the playlist. But it also calls: addToMyPlayList().

on createMyPlaylist() — creates your playlist
  1.  try
  2.   tell application "iTunes"
  3.    set newPlayList to make new user playlist with properties {name:myPlaylistName}
  4.   end tell
  5.   addToMyPlayList()
  6.  on error
  7.   errorCouldNotCreatePlayList()
  8.  end try
  9. end createMyPlaylist

addToMyPlayList()
Here we are adding the above set URLs to the newly created playlist. After this is done, it will start playing the list.

on addToMyPlayList()
  1.  tell application "iTunes"
  2.   try
  3.    repeat with i from 1 to number of items in listOfUrls
  4.     set myUrl to item i of listOfUrls
  5.     tell application "iTunes"
  6.      set my_playlist to myPlaylistName – set the target playlist
  7.      open location myUrl – open an URL from the list
  8.      stop – but don't play right away
  9.      set new_stream to (some URL track of library playlist 1 whose address is myUrl)
  10.      duplicate new_stream to playlist my_playlist –copy it into the playlist
  11.      set view of front browser window to playlist my_playlist
  12.     end tell
  13.    end repeat
  14.   on error
  15.    errorCouldNotAddToPlayList()
  16.   end try
  17.  
  18.   set sound volume to myVolume
  19.   set EQ enabled to enableMyEQ
  20.   try
  21.    tell playlist my_playlist
  22.     play track (get name of new_stream)
  23.     set view of front browser window to user playlist myPlaylistName –sets focus
  24.    end tell
  25.   on error
  26.    –display dialog "DEBUG: addToMyPlayList – could not play" with icon 0
  27.    errorCouldNotPlay()
  28.   end try
  29.  end tell
  30.  
  31. end addToMyPlayList

hideItunes()
After everything is done, this will minimize the iTunes window.

on hideItunes() –this simply hides (minimize to dock) the iTunes window
  1.  tell application "Finder"
  2.   set the visible of every process whose name is "iTunes" to false
  3.  end tell
  4. end hideItunes

3. Errors

Sometimes an operation isn’t successful. To catch these problems, the script has some error handlers

errorCouldNotPlay()
If the playback couldn’t be started, this will ask the user how it should proceed. If the decision is: try again, it’ll wait for a second before the next attempt. If this one also fails, it will close for good.

on errorCouldNotPlay()
  1.  set answer to the button returned of (display dialog "Couldn't start playback" buttons {"Try again", "Cancel"} default button 1)
  2.  if answer = "Try again" then
  3.   delay 1 – wait for one second
  4.   startPlayBackOfPlayList()
  5.  else
  6.   error number -128 – end script
  7.  end if
  8. end errorCouldNotPlay

errorCouldNotAddToPlayList()
If addToMyPlayList()
caused an error, this one will try it again.

on errorCouldNotAddToPlayList()
  1.  set answer to the button returned of (display dialog "Couldn't add URLs to playlist" buttons {"Try again", "Cancel"} default button 1)
  2.  if answer = "Try again" then
  3.   delay 1 – wait for one second
  4.   addToMyPlayList()
  5.  else
  6.   error number -128 – end script
  7.  end if
  8. end errorCouldNotAddToPlayList

errorCouldNotCreatePlayList()
And the same thing for createMyPlaylist().

on errorCouldNotCreatePlayList()
  1.  set answer to the button returned of (display dialog "Couldn't create playlist" buttons {"Try again", "Cancel"} default button 1)
  2.  if answer = "Try again" then
  3.   delay 1 – wait for one second
  4.   createMyPlaylist()
  5.  else
  6.   error number -128 – end script
  7.  end if
  8. end errorCouldNotCreatePlayList

4. Calls

The only thing left to do, is to call all our functions in the right order.

try
  1.  if checkIfPlayListExists() = false then
  2.   createMyPlaylist() – if your playlist doesn't exist, create it, add URLs and start playback
  3.  else
  4.   startPlayBackOfPlayList() – if your playlist exists, start playback
  5.  end if
  6. on error
  7.  startPlayBackOfPlayList() – if your playlist exists, start playback
  8. end try
  9.  
  10. hideItunes()

This should have been the final version – but maybe I’ll add a timer into it, so it will start playing automatically in the morning…

Categories: iTunes Tags: ,

How to tell iTunes to play my favorite online radio station (version 2)

April 7th, 2010 1 comment

Otvoreni RadioLike I said, I consider this application a training exercise. Therefore version 2 is already finished. The goal was to fill the new playlist with alternative URLs for my favorite online radio. In case, that one of the servers is overloaded or down, it will still play my music.

Additionally I added some more error handling and global variables. This should make it easier for you to modify this script for your own purposes.

Application

Here you can download the already compiled application: Play Otvoreni Radio Application V2.

AppleScript

After receiving some complaints, that my code snippets aren’t readable on an iPhone, I decided to add a PDF version of the script:
Play Otvoreni Radio Script V2 (PDF version)
This isn’t a real fix but I’ll at least display the script correctly on your iPhone ;-)

global myPlaylistName — set the name of the playlist
  1. set myPlaylistName to "Otvoreni Radio"
  2.  
  3. global myUrl01 – set the URl for the 1st track
  4. set myUrl01 to "http://tv29.stream-music.net:8200/"
  5.  
  6. global myUrl02 – set the URl for the 2nd track
  7. set myUrl02 to "http://tv27.stream-music.net:8100/"
  8.  
  9. global myUrl03 – set the URl for the 3rd track
  10. set myUrl03 to "http://82.193.201.234:8001/"
  11.  
  12. global myUrl04 – set the URl for the 4th track
  13. set myUrl04 to "http://213.147.125.75:8003/"
  14.  
  15. global myVolume – set your desired volume (default is 50%)
  16. set myVolume to 50
  17.  
  18. global enableMyEQ – decide if the EQ will be enabled
  19. set enableMyEQ to true
  20.  
  21. – FUNCTIONS
  22. on startPlayBackOfPlayList() – starts the playback of your playlist
  23.  try
  24.   tell application "iTunes"
  25.    set sound volume to myVolume
  26.    set EQ enabled to enableMyEQ
  27.    play user playlist myPlaylistName –this plays the first track of the iTunes playlist called "Radio"
  28.   end tell
  29.  on error
  30.   errorCouldNotPlay() – display error and offer a retry
  31.  end try
  32. end startPlayBackOfPlayList
  33.  
  34. on checkIfPlayListExists() – checks if your playlist exists
  35.  set checkList to myPlaylistName
  36.  tell application "iTunes"
  37.   exists user playlist checkList
  38.  end tell
  39. end checkIfPlayListExists
  40.  
  41. on createMyPlaylist() – creates your playlist
  42.  try
  43.   tell application "iTunes"
  44.    set newPlayList to make new user playlist with properties {name:myPlaylistName}
  45.   end tell
  46.   addToMyPlayList()
  47.  on error
  48.   errorCouldNotCreatePlayList()
  49.  end try
  50. end createMyPlaylist
  51.  
  52. on addToMyPlayList() – adds the URLs to your playlist
  53.  tell application "iTunes"
  54.   try
  55.    –url01
  56.    set my_playlist to myPlaylistName – set the target playlist
  57.    open location myUrl01 – open the URL
  58.    stop – but don't play right away
  59.    set new_stream to (some URL track of library playlist 1 whose address is myUrl01)
  60.    duplicate new_stream to playlist my_playlist –copy it into the playlist
  61.    set view of front browser window to playlist my_playlist
  62.    –url02
  63.    set my_playlist to myPlaylistName
  64.    open location myUrl02
  65.    stop
  66.    set new_stream to (some URL track of library playlist 1 whose address is myUrl02)
  67.    duplicate new_stream to playlist my_playlist
  68.    set view of front browser window to playlist my_playlist
  69.    –url03
  70.    set my_playlist to myPlaylistName
  71.    open location myUrl03
  72.    stop
  73.    set new_stream to (some URL track of library playlist 1 whose address is myUrl03)
  74.    duplicate new_stream to playlist my_playlist
  75.    set view of front browser window to playlist my_playlist
  76.    –url04
  77.    set my_playlist to myPlaylistName
  78.    open location myUrl04
  79.    stop
  80.    set new_stream to (some URL track of library playlist 1 whose address is myUrl04)
  81.    duplicate new_stream to playlist my_playlist
  82.    set view of front browser window to playlist my_playlist
  83.   on error
  84.    errorCouldNotAddToPlayList()
  85.   end try
  86.  
  87.   set sound volume to myVolume
  88.   set EQ enabled to enableMyEQ
  89.   try
  90.    tell playlist my_playlist
  91.     play track (get name of new_stream)
  92.    end tell
  93.   on error
  94.    –display dialog "DEBUG: addToMyPlayList – could not play" with icon 0
  95.  
  96.   end try
  97.  end tell
  98. end addToMyPlayList
  99.  
  100. on hideItunes() –this simply hides (minimize to dock) the iTunes window
  101.  tell application "Finder"
  102.   set the visible of every process whose name is "iTunes" to false
  103.  end tell
  104. end hideItunes
  105.  
  106. – ERRORS
  107. on errorCouldNotPlay()
  108.  set answer to the button returned of (display dialog "Couldn't start playback" buttons {"Try again", "Cancel"} default button 1)
  109.  if answer = "Try again" then
  110.   delay 1 – wait for one second
  111.   startPlayBackOfPlayList()
  112.  else
  113.   error number -128 – end script
  114.  end if
  115. end errorCouldNotPlay
  116.  
  117. on errorCouldNotAddToPlayList()
  118.  set answer to the button returned of (display dialog "Couldn't add URLs to playlist" buttons {"Try again", "Cancel"} default button 1)
  119.  if answer = "Try again" then
  120.   delay 1 – wait for one second
  121.   addToMyPlayList()
  122.  else
  123.   error number -128 – end script
  124.  end if
  125. end errorCouldNotAddToPlayList
  126.  
  127. on errorCouldNotCreatePlayList()
  128.  set answer to the button returned of (display dialog "Couldn't create playlist" buttons {"Try again", "Cancel"} default button 1)
  129.  if answer = "Try again" then
  130.   delay 1 – wait for one second
  131.   createMyPlaylist()
  132.  else
  133.   error number -128 – end script
  134.  end if
  135. end errorCouldNotCreatePlayList
  136.  
  137. – CALLS
  138. try
  139.  if checkIfPlayListExists() = false then
  140.   createMyPlaylist() – if your playlist doesn't exist, create it, add URLs and start playback
  141.  else
  142.   startPlayBackOfPlayList() – if your playlist exists, start playback
  143.  end if
  144. on error
  145.  startPlayBackOfPlayList() – if your playlist exists, start playback
  146. end try
  147.  
  148. hideItunes()

This time, I left the comments in.
If you like, you can download the .scpt file here: Play Otvoreni Radio Script V2.

Categories: iTunes Tags: ,

Need an iPhone-style icon?

April 6th, 2010 No comments

Flavor Studios Icon Generator

Every now and then I need a nice icon or logo. This time, the mobile version of this blog needed an iPhone home screen icon. A while ago I stumbled across a how-to for such icons. But luckily, before I tried my luck with Photoshop, I found a neat online service for that task:
iPhone Icon, Favicon, .ico Generator.

The iPhone application icon generator is a free tool to create iPhone-like favicons, apple-touch-icon png’s, and .ico files for use in windows.

Upon uploading your image and selecting the icon options, you will be shown a preview of the image as well as a zip file containing the following:

• 256×256 PNG Graphic with transparent background. (for any use)
• 60×60 PNG Graphic for use as a apple-touch-icon. (iPhone & iTouch)
• An ICO File with transparent background for use as a favicon for your website or to use as a windows icon for anything you desire. (icon sizes up to 256×256 are included in .ico file)
• A readme.txt file showing the proper implementation of the favicons for both normal web browsers and the iPhone/iPod Touch browsers.

We ♥ love icons – iConvert

While we are at it, I’d like to recommend another great & free online service - iConvert

Have you ever discovered the perfect icon set, only to find it wasn’t available for your particular platform? iConvert solves the problem: With this free tool, you can convert any common icon or image into an icon specifically for your platform. iConvert allows you to easily convert Windows icons to Mac OS X icons, SVG icons to Windows icons, PNG icons to Mac OS X icons, JPG images to Windows icons, and much more. Simply upload a file in one of the supported formats, and iConvert will do the rest!

Right now, iConvert isn’t creating iPhone style or favicon file – nut they are working on that as well.

And they really like what they are doing:

We Love Icons is a project by designers Dan Wiersema and Nando Albuquerque. We started We Love Icons because, well… we love icons!
Our sole purpose is to provide you with ONE place to go to find links to the BEST freeware icons on earth.

Categories: Development, iPhone Tags: ,

How to tell iTunes to play my favorite online radio station

April 3rd, 2010 3 comments

This particular example might not be too useful for the most of you. But maybe it’ll come in handy when you are trying something similar…

Otvoreni Radio I like listening to a certain radio station: Otvoreni Radio.
To be able to start it more easily, I created an applescript.

This script not only starts the playback, it also creates a new playlist and adds the URL track to it. Packed as application, this script can be now used directly from the dock.

I took this task as an training exercise. So I tried to add some thing I hold very dear in other programming languages – like error handling or function calls.

While searching for some advice I found Doug’s website.
He has a great collection of very useful AppleScripts!

The application:

If you like my solution, you can download it here: PlayOtvoreniRadio application.
Inside the zip archive you’ll find the already compiled application.

If you like to modify it to your needs, just copy the AppleScript code below into a new .scpt file (see how to do this here)

AppleScript code:

try

checkPlayList()

on error errText

checkPlayListError()

end try

hideItunes()

on checkPlayList()

tell application “iTunes”

set checkList to “Otvoreni Radio”

if exists user playlist checkList then

tell application “iTunes”

set sound volume to 40

set EQ enabled to true

play track 1 of user playlist “Otvoreni Radio”

end tell

else

set newOtvoreni to make new user playlist with properties {name:”Otvoreni Radio”}

set stream_URL to “http://tv29.stream-music.net:8200/”

set my_playlist to “Otvoreni Radio”

open location stream_URL

stop

set new_stream to (some URL track of library playlist 1 whose address is stream_URL)

duplicate new_stream to playlist my_playlist

set view of front browser window to playlist my_playlist

tell playlist my_playlist

play track (get name of new_stream)

end tell

end if

end tell

end checkPlayList

on checkPlayListError()

set answer to the button returned of (display dialog “Couldn’t play Otvoreni Radio…” buttons {“Try again”, “Cancel”} default button 1)

if answer = “Try again” then

directPlay()

end if

end checkPlayListError

on directPlay()

tell application “iTunes”

set sound volume to 40

set EQ enabled to true

try

play track 1 of user playlist “Otvoreni Radio”

on error

open location “http://tv29.stream-music.net:8200/”

end try

end tell

end directPlay

on hideItunes()

tell application “Finder”

set the visible of every process whose name is “iTunes” to false

end tell

end hideItunes

on airTunes()

–I’m working on an easy/elegant way to select predefined (or selectable) AirTunes speaker

end airTunes

As you can see, the AirTunes part isn’t finished yet. It seems that there is no (easy) way to select and change AirTunes speakers via AppleScript.

For better readability, I removed my comments from the code – if you like to see them, just download the original .scpt file here.

Categories: iTunes Tags: , ,

Automatically changing iChat status when leaving your Mac

April 3rd, 2010 No comments

For quite some time I was searching for a way to lock/unlock my Mac automatically when leaving it. This should have been done by detecting that my iPhone is out of (bluetooth) range. A little and ingenious application from reduxcomputing helped me to achieve this: Proximity.

Proximity

Proximity monitors the proximity of your mobile phone or other bluetooth device and executes custom AppleScripts when the device goes out of range or comes into range of your computer.
(original description from reduxcomputing)

This allowed me to configure my Mac to pause iTunes, set all my messenger clients to away and to close Mail when I was leaving. Upon my arrival back at my Computer, Proximity executed another script which resumed iTunes, opened Mail again and set the messenger clients back to Online or Available.

1. Download and install Proximity

First you’ll have to download and install Proximity. The installation is as easy as possible: just move the Proximity.app to your application folder. You can find the most recent version of Proximity here: http://code.google.com/p/reduxcomputing-proximity/downloads/list

Make sure that Proximity is set up as Startup item (http://support.apple.com/kb/HT2602).

2. Connect your iPhone (or any other Bluetooth enable device)

Make sure that you have activated bluetooth on your Mac and made your phone discoverable. Open the preferences of Proximity and press “Change device” in the “Bluetooth Device” section. This will open the “Select Bluetooth Device” window. After a couple of seconds it should display your phone.

Select Bluetooth device

Select pour phone, activate “Remember this device” and press “Select”.  You can use any other Bluetooth enabled device as proximity sensor.

3. Configure AppleScripts

Download my ProximityScripts or create your own AppleScripts.

In the “AppleScripts” section you can choose what Proximity will do when you leave or enter the Bluetooth range of your Mac. Select the desired scripts and close the Preferences window again.

Proximity preference

4. Modify the AppleScripts

If you have chosen to use my scripts, you probably should have a look at them. They can modify the following applications/features:

  • iTunes: fade out and pause playback / resume playback
  • Mail: close application / start and hide application
  • Adium, Skype & iChat: set status to away / available (only iChat is actually enabled in my scripts)
  • Sleep: put your Mac to sleep (this can’t be undone via Proximity, you’ll need to wake it manually via the keyboard or mouse)

To change any of the above mentioned settings, you have to open the scpt file with AppleScript Editor. I tried to make it as self-explanatory as possible. Every application/feature is marked by its name and with comments on how to activate or deactivate them.

This is the “LeaveMyMac.scpt” file:

LeaveMyMac.scpt

And Return2MyMac.scpt”:

Return2MyMac.scp(click to enlarge or download them here)

5. Test it

To test it, you can either try to escape the bluetooth range of your computer or simply deactivate the Bluetooth module of you phone. Depending on the time you set in the preferences of Proximity (by default it’s 60 seconds), your Mac will silence iTunes (if you started it before) and set your messenger to away. Activating bluetooth on your phone again, will resume your music and let your friends know, that you are available again.

While searching for a suitable solution, I came across many good instructions and ideas on how to manage such a task. Here are some of the best articles I found:

Airlock

Lock your screen

What’s with the locking feature? After experiencing several problems, I stopped using AppleScripts to lock/unlock my Mac. If you’d like such a feature, you should try M.H.A.’s Airlock.

It’s not free, but worth its money (you can of course try it for free first).

Speaking of free – Proximity is donation-ware. So if you like it, maybe you consider donating to the developer (as soon as his donation page is working again ;-) ).

Middle mouse button on Apple’s Magic Mouse

April 3rd, 2010 No comments

I’m sure, many of you know and value the Exposé feature of Mac OS X. For quite some time I had the middle mouse button of my Mighty Mouse set to activate Exposé.

Exposé & Spaces

This can be set in “Exposé & Spaces”.

The Magic Mouse doesn’t have a middle button any more. To be still able to easily access Exposé (or any other feature) you’ll need to use a third party application.

I decided to use BetterTouchTool from Andreas Hegenberg.

How to use BetterTouchTool for Exposé


BetterTouchTool settings

BTT can do much more than simulating the missing middle button. You can connect a huge number of functions to customizable gestures. You’ll see it yourself as soon as you start using it.

I’ll stick to the Exposé function, for now.

After some testing, I decided, that the “Single Finger Tap” was the most suitable gesture for me. You might decide differently. After pressing “+ Add new gesture”, all you have to do, is select the desired gesture and the “Predefined Action” – in my case: “Exposé”:

Select desired BTT gesture -> Choose Expose

That’s it! From now on, you can easily access Exposé (or any other desired feature) with only a fingertip.

A more detailed documentation of all BetterTouchTool features can be found on its website: http://blog.boastr.net/?page_id=1619

Categories: Mac OS X Tags: , ,

How to train Mail.app to use Gmail properly

April 3rd, 2010 3 comments

What’s not to love: Mail.app looks great and does everything right; Gmail is fast, reliable and innovative. Using IMAP for communication, you got the best out of them. But bringing those two together the way I wanted wasn’t so easy.

Sticking to the instructions brought my mails to my Mac. But after a couple of days I noticed some strange behavior:

  • Redundant Gmail folders (All Mail, Drafts, etc.)
  • Double entries in Spotlight
  • Wrong number of (unread) messages displayed

The internet is full of good advise on how to use Apple’s Mail with Gmail and IMAP. Two of them helped me to find my optimal solution (thanks to Joel & Willem).

But most of the pages assume, that one is actually using Gmail via the web interface and is accustomed to the labels (and wants to keep them). Myself, on the other side, came from a PC and Outlook and almost never used the web interface.

If you like to use labels or need to know how to easily create Gmail labels in Apple’s Mail application: read Joel’s instructions.

Here’s my way to tame Gmail/Apple Mail:

1. Setup your Gmail account in Mail

I recommend using IMAP for your Gmail account. Personally, I use Google Apps but with Gmail it’s all the same. Please check Google’s instructions for more details.

GMail IMAP setup

2. Modify your Mailbox Behaviors

I’ve chosen to save everything online. If you check all the “Store [...] on the server” options, you end up with a clean Mail folder structure.

Make your own decision about “Permanently erase deleted messages when:”.

Apple Mailbox Behavior

3. Use Spam & Junk together

To be able to unify Apple’s Junk and Google’s Spam features, you need to activate:

“Move it to the Junk Mailbox” in “When junk mail arrives:”

Without that setting, you can’t complete the next step for the Spam IMAP folder.

Apple Mail Junk Mail Settings

4. Train Mail to use Gmail’s folders instead of its own

Select the the “Spam” IMAP folder and connect it to Mail’s Junk function and press “Use This Mailbox For” > “Junk” from the “Mailbox” menu.

Use This Mailbox For

Repeat this for the three remaining features: Drafts, Sent and Trash.
This will remove the redundant IMAP folders from Mail.

Redundant Gmail folders

5. Enable Google Labs’ Advanced IMAP Controls

Login to your Gmail web interface. Access your settings and go to “Labs”.

Gmail labs

Enable “Advanced IMAP Controls” (don’t forget to save your changes).

This will help getting rid of the double spotlight search results.

Enable Google labs IMAP Controls

6. Hide “All Mail” and “Starred” from your folder list

By disabling “Show in IMAP” for “Starred” and “All Mail” (in the Labels settings), the last redundant folders will disappear from Mail. With that, the double search results will also vanish. As a positive side effect, Mail will start counting the correct amount of messages.

FYI: Flagged messages are being marked Starred in Gmail.

Hide unwanted label

The result:

Clean Gmail/Mail folder structureIn the end, Mail.app will put all messages in the correct online folders.

All incoming mails will be shown in “Inbox”. Also Drafts, Sent items, deleted mails and Spam messages will be stored in the default Mail folders.

Using Spotlight will be much more effective. Before I made these changes many messages appeared three times in my search results: one from the Inbox, one from All Mail and one from the Starred folder. This unnecessarily increased the number of found mails and made actually finding something more difficult.

Please keep in mind, this is only my personal opinion regarding the best way to configure Apple’s Mail with Gmail’s IMAP service.

Categories: Mac OS X, Mail Tags: , , ,