Skip navigation

How do I permanently change the icons for .xyz files?

376 Views 10 Replies Latest reply: Feb 11, 2013 8:41 AM by softwater RSS
Dorkowang Calculating status...
Currently Being Moderated
Feb 11, 2013 3:50 AM

I cannot manage to change the icon for my .pl files in OS X 10.7.5

 

This works:

 

I have perl scripts which have the extension .pl. I edit them with BBEdit and run them in the terminal.app. The scripts contains a shebang line and I have assigned all .pl extension to open with the terminal. So clicking on a .pl file runs the perl script.

 

This is what I want:

 

I would like all .pl files to have the same icon, so I can recognize them immediately as such. The assignment of the Icon should automatically happen when I generate a file, as I am to lazy to change the Icons manually for each file. (I know how to do this)

 

 

This is what I did, but does not work:

 

I got a .jpg file which I converted to png and renamed to PerlIcon.icns

 

Inside the terminal.app package I saved latter file into the folder Contents/Resources/

 

In the Info.plist file I also included following code inside <key>CFBundleDocumentTyper<key><array> ... </array>:

 

            <dict>

            <key>CFBundleTypeExtensions</key>

            <array>

                       <string>pl</string>

            </array>

            <key>CFBundleTypeIconFile</key>

            <string>PerlIcon.icns</string>

            <key>CFBundleTypeName</key>

            <string>Perl Script</string>

            <key>CFBundleTypeRole</key>

            <string>Viewer</string>

            </dict>

           

This is not working. I also changed "PerlIcon.icns" to "PerlIcon" and/or "Viewer" to "Editor".

           

As this is also not working. I tried the same with the BBEdit application package, but still I do not get the icon assignement I want.

 

What am I doing wrong?

 

Many thanks for any help

 

Claudio

Mac OS X (10.7.2)
  • softwater Level 5 Level 5 (5,370 points)

    You can't create a valid .icns file just by changing a jpg file extension. You have to use the iconutil utility in Terminal after you have made an iconset folder.

     

    I wrote a tutorial up for how to do this here:

     

    http://applehelpwriter.com/2012/12/16/make-your-own-icns-icons-for-free/

     

    (ToU Disclaimer: this links to my personal website).

  • softwater Level 5 Level 5 (5,370 points)

    Looks like that 'r' is wrong at the end of 'CFBundleDocumentTyper'

     

    In the Info.plist file I also included following code inside <key>CFBundleDocumentTyper<key><array> ... </array>:

     

     

    Shouldn't that 'r' be an 's'?

     

    <key>CFBundleDocumentTypes<key><array> ... </array>:

    OS X Mountain Lion (10.8.2)
  • softwater Level 5 Level 5 (5,370 points)

    You have

     

    <string>Perl Script</string>

     

    I don't believe you can have a space in the string. Try wrapping it in double quotes, like this:

     

    <string>"Perl Script"</string>

    OS X Mountain Lion (10.8.2)
  • softwater Level 5 Level 5 (5,370 points)

    Did you log out and log back in again? You need to let the system reload all the plist files.

  • softwater Level 5 Level 5 (5,370 points)

    I'm also not sure why you're putting this in the Terminal.app info plist.

     

    Have you associated all .pl files to be opened with Terminal in a .pl file's 'Get Info' box?

  • softwater Level 5 Level 5 (5,370 points)

    No, sorry. Nothing I can think of right now.

     

    I'd imagine the by default Xcode would be the run handler for perl scripts, but I'm not sure if that helps you in any way.

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.