abitofcode

Creating a custom URL icon in the dock

A work around to change the default URL icon when adding web links to the dock in OSX. From this;
2013_04_11_a

To this;

2013_04_11_e

We can’t change the icon on the link itself but we can add the link to a folder and change the folder icon. The first step is to create a folder somewhere and drag the links into it from your browser of choice.

Changing the folder icon

Find the image you want to use as the new icon and grab a squareish section of it using preview. We need to grab this into the clipboard using Copy (⌘ + c). Alternatively you can screen capture it directly using ⇧ + ⌘ + 4 to bring up a selection crosshairs and then before making the selection holding down the Control key to copy directly into the clipboard rather than depositing the selection as a file on the Desktop.

2013_04_11_g

Select the folder to have it’s icon changed and open the Info panel (⌘ + i)
2013_04_11_f

Select the small Icon towards the top of the Info panel and Paste the contents of the clipboard (⌘ + v). The folder icon should now be your selected image.

2013_04_11_h

Adding the link to the Dock

Drag the updated folder onto the right hand side of the Dock (anywhere after the dividing line). If it doesn’t show the new icon make sure you have it selected to display as Folder and not Stack (right click on the folder to find this setting).

2013_04_11_c

When the folder is selected the links inside will be displayed.

2013_04_11_d

I have a folder set up within Applications to group all the cocos2d tools I use regularly and have used the same approach to make the folder a little more recognisable.

2013_04_11_e

2 Comments

  1. Nice man… But how to get the transparent image like u get of cocos2D.. :)

  2. @Hamdullah Cheers :) To handle the transparency you need a PNG with transparency in it. Try the following;

    1. Open the image in preview
    2. Edit > Select All (? + a)
    3. Select the small icon in the folders info window
    4. Paste (? + v)

    The cocos2d logo I used is available here http://www.cocos2d-iphone.org/wiki/lib/exe/fetch.php/resources:official-cocos-logo-portrait-happy.png?w=160