[Pythonmac-SIG] Questions on doing some OS X-specific stuff: Adding file/folder icons from Python?

David Remahl david at ittpoi.com
Sat May 29 05:57:40 EDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 29 maj 2004, at 11.18, Kenneth McDonald wrote:

> As a 'fun' project to start learning about calling OS X functionality
> from Python, I thought it'd be neat to write a little app that would
> go through my photo album (just a whole bunch of dirs with
> related pictures in each, not an iPhoto album) and
>
> 1) Add a permanent thumbnail to each image.
> 2) Put a custom folder icon on each folder, consisting
> of a thumbnail of the first image in the folder. (Digital
> cameras are great, but man, I'm sorta astounded at
> the number of pictures I've taken...)
>
> I can use PIL (I assume) to do the image-related stuff, but
> what's the best way to attack the assigning-icons-to-files/folders
> stuff? PyObjC? I seem to remember reading that Python can
> communicate with Applescript, would that be a better route?
> At the moment, I know nothing about accessing OS X from
> Python, so I'm really just looking for a good way to start
> learning. All I want to do with this first thing is to learn how to
> make a few OS X calls.

May I suggest using PyObjC <http://pyobjc.sf.net/>, with the IconFamily 
class by Troy Stephens et.al. (including me)?

Using Cocoa with Python makes your task very simple. You can probably 
leave PIL out too, and use Cocoa's image processing functionality.

/ Regards, David Remahl

- --- PGP key information---
pub  1024D/ 87256085 2003/06/12 David Remahl <david at remahl.se>
Web: http://ittpoi.com/david_remahl.asc
Fingerprint: 0C38 293C 86A9 7756 9CEA  4ED6 1651 620E 8725 6085
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFAuF6WFlFiDoclYIURAogkAJ4sEaIzay9KuG14ydxdES9tVBYarQCdETXw
9tDDighhkhJRB7+rPMMdZXU=
=zDa0
-----END PGP SIGNATURE-----




More information about the Pythonmac-SIG mailing list