# Set an Icon to a custom file

**URL:** <https://forum.xojo.com/t/set-an-icon-to-a-custom-file/57362>\
**Category:** General\
**Created:** [September 24, 2020, 3:21pm UTC](https://forum.xojo.com/t/set-an-icon-to-a-custom-file/57362 "2020-09-24T15:21:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 24, 2020, 3:21pm UTC](https://forum.xojo.com/t/set-an-icon-to-a-custom-file/57362/1 "2020-09-24T15:21:29Z")

</div>

1. I created a File Type for that Custom File,
2. I add an icon to it,
3. In macOS, I set the FileTypes data (read/write),
4. When I double click on my file (macOS), my application is fired, my file is loaded,
5. When I drop my custm file above my application Icon, that file is opened (and the application fired if needed),
6. Right-Click on a custom file --\> _Opens with…_ display my application name.

But, I do not have my custom icon on my custom files.

Nota: I set a custom icon for json files and this worked fine… a plist comarison leads to nothing.

What did I forgot ?

PS: that worked fine, long time ago on **BOTH** macOS and Windows platforms.

PPS: json reading is not yet implemented… in the application (I think I forgot to add it !)

---

<div class="post-metadata">

**Author:** ![Stéphane\_Mons](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@Stéphane\_Mons](https://forum.xojo.com/u/St%C3%A9phane_Mons)\
**Post date:** [September 25, 2020, 2:28pm UTC](https://forum.xojo.com/t/set-an-icon-to-a-custom-file/57362/2 "2020-09-25T14:28:54Z")

</div>

You may want to rebuild the LaunchServices Database. See [https://eclecticlight.co/2017/08/11/launch-services-database-problems-correcting-and-rebuilding/](https://eclecticlight.co/2017/08/11/launch-services-database-problems-correcting-and-rebuilding/)

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 25, 2020, 2:36pm UTC](https://forum.xojo.com/t/set-an-icon-to-a-custom-file/57362/3 "2020-09-25T14:36:50Z")

</div>

Thank you Stephane.

Nota: I have the same problem under Windows…

Now, I will read your linked page.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 25, 2020, 3:19pm UTC](https://forum.xojo.com/t/set-an-icon-to-a-custom-file/57362/4 "2020-09-25T15:19:29Z")

</div>

Side-effect:  
my hard disk (SSD) write speed increase by 20MBs…

I still do not have the custom icon.

At first run after the Terminal command (Desktop rebuild), I was asked “this is the first time you run application XYZ…”.

I will re-issue the command to rebuild the Launch Services Database (I booted on a High Sierra external HDD).

---

<div class="post-metadata">

**Author:** ![Arnaud\_N](https://forum.xojo.com/user_avatar/forum.xojo.com/arnaud_n/32/21824_2.png) [@Arnaud\_N](https://forum.xojo.com/u/Arnaud_N)\
**Post date:** [September 25, 2020, 3:39pm UTC](https://forum.xojo.com/t/set-an-icon-to-a-custom-file/57362/5 "2020-09-25T15:39:48Z")

</div>

> [@Emile\_Schwarz](#):
>
> I have the same problem under Windows…

Then I doubt it’s a problem about rebuilding the Mac desktop database.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 25, 2020, 4:01pm UTC](https://forum.xojo.com/t/set-an-icon-to-a-custom-file/57362/6 "2020-09-25T16:01:13Z")

</div>

It cost nothing to try (yes, I doubt too).

The first (2013 and some following) Xojo versions generate correctly the whole (two differents custom documents icons), them somewhere around Xojo 2015r1 it stopped.

One thing is sure, this looks nicer with the custom icons.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 25, 2020, 5:13pm UTC](https://forum.xojo.com/t/set-an-icon-to-a-custom-file/57362/7 "2020-09-25T17:13:57Z")

</div>

More changes…

Dialogs in GIMP comes into the main screen, no more in the external screen… YEAH !

Maybe El Capitan have troubles… after all.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 4:42pm UTC](https://forum.xojo.com/t/set-an-icon-to-a-custom-file/57362/8 "2021-04-29T16:42:42Z")

</div>


