Re: OT: scriptually? create custom folder icon
Re: OT: scriptually? create custom folder icon
- Subject: Re: OT: scriptually? create custom folder icon
- From: Geoff Lee <email@hidden>
- Date: Tue, 15 Dec 2009 10:34:41 +0000
On 15 Dec 2009, at 10:11, Mo McRoberts wrote:
> On 15-Dec-2009, at 10:07, Geoff Lee wrote:
>>
>> Sorry this is a bit off topic but this seems like the kind of place I might find an answer. I want to assign a custom icon to a folder using, ideally, a bit of shell script/perl/python, though I'm not averse to building a little binary if that will do the trick.
>
> You want the Rez and SetFile utilities, which will do it for you.
>
> (a script which I have to do it as part of a build here, adjust ${CONFIGURATION_TEMP_DIR}/icon-resource.icns to suit):
Fantastic. I had never noticed the Rez tool before: it's exactly what I need.
Thanks a lot!
-geoff
>
> #! /bin/sh
>
> icon="$SCRIPT_INPUT_FILE_0"
> target="$SCRIPT_OUTPUT_FILE_0"
>
> REZ=/Developer/usr/bin/Rez
> SETFILE=/Developer/usr/bin/SetFile
>
> cp "$icon" ${CONFIGURATION_TEMP_DIR}/icon-resource.icns || exit $?
> echo "read 'icns' (-16455) \"icon-resource.icns\";" > ${CONFIGURATION_TEMP_DIR}/icon-resource.r
> ifile="`printf \"$target/Icon\r\"`"
> $REZ -o "$ifile" ${CONFIGURATION_TEMP_DIR}/icon-resource.r || exit $?
> rm -f ${CONFIGURATION_TEMP_DIR}/icon-resource.icns
> rm -f ${CONFIGURATION_TEMP_DIR}/icon-resource.r
> $SETFILE -a C "$target"
> $SETFILE -a V "$ifile"
>
> Cheers,
>
> Mo.
>
> --
> mo mcroberts
> http://nevali.net
> iChat: email@hidden Jabber/GTalk: email@hidden Twitter: @nevali
>
> Run Leopard or Snow Leopard? Set Quick Look free with DropLook - http://labs.jazzio.com/DropLook/
>
>
>
>
>
>
>
>
>
______________________________________
Geoff Lee <email@hidden>
Computing Support
School of Arts, Culture and Environment
University of Edinburgh
20 Chambers St,
Edinburgh, Scotland,
EH1 1JZ
Tel: +44 (0)131 650 2341
______________________________________
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden