• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Set Document Icon from Command Line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set Document Icon from Command Line


  • Subject: Re: Set Document Icon from Command Line
  • From: "Ken Mankoff" <email@hidden>
  • Date: Wed, 18 Apr 2007 12:34:26 -0400

I'm sure the code sample there would work, but I've been provided with a much simpler solution using tools already installed. You can see it here:

http://forums.macosxhints.com/showthread.php?p=372418#poststop

Summarized as:

sips -i
donorfile.jpg
/Developer/Tools/DeRez -only icns donorfile.jpg > tempicns.rsrc
/Developer/Tools/Rez -append tempicns.rsrc -o recipientfile.xyz
/Developer/Tools/SetFile -a C recipientfile.xyz

  -k.


On 4/11/07, Deric Horn <email@hidden> wrote:
Hi Ken,

Take a look at the SetCustomIcon sample code, specifically the routine SaveCustomIcon() available here:
<http://developer.apple.com/samplecode/SetCustomIcon/>

The sample is a bit dated but the concepts still apply,
Deric Horn
Mac OS X Application Technologies Evangelist
Apple Worldwide Developer Relations
email@hidden

>
> Hi List,
>
> I was sent here from the Installer-Dev list with the following question:
>
> Is there a way to set the document icon from the command line? I am able to
> set a folder icon by copying the "Icon^M" file into the directory, but have
> not found a way to do this for a file/document. I know about the 'hidden'
> rsrc/ sub-folder attached to every file, and am comfortable using the Rez and
> DeRez CLI tools, but their man page did not help...
>
> Currently I do it manually by doing a Get Info, then pasting, but would like
> to automate the build + release process.
>
> Any suggestions will be appreciated.
>
> Thanks,
>
>    -k.
>
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Filesystem-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:

>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Set Document Icon from Command Line (From: "Ken Mankoff" <email@hidden>)
 >Re: Set Document Icon from Command Line (From: Deric Horn <email@hidden>)

  • Prev by Date: Re: Set Document Icon from Command Line
  • Next by Date: Mount Point from BSDName / IORegistry
  • Previous by thread: Re: Set Document Icon from Command Line
  • Next by thread: Mount Point from BSDName / IORegistry
  • Index(es):
    • Date
    • Thread