Generic file icons in list view

Hello,

Files created with myApp are displayed on the desktop with their true icons.
When placed in a folder they retain their true icons when viewed as icons, but are displayed with generic, (plain), icons in list or column view.

What am I missing?

Mac OSX 10.10…4

Thanks.

Lennox

[quote=198070:@Lennox Jacob]Hello,

Files created with myApp are displayed on the desktop with their true icons.
When placed in a folder they retain their true icons when viewed as icons, but are displayed with generic, (plain), icons in list or column view.
[/quote]
Are you providing all of the icon sizes for the file type?

Hi Greg,

Thanks.
Yes I have all 10 images and all 10 masks.

I have a .bmp file that I open in preview, I "select al"l then “paste” it in all 10 icon sizes. Is that the correct way?

Thanks again.

Lennox

http://www.shareaschnitzel.com/how-to-create-icons-for-mac-os-x/

  • copy this code to AppleScript-Editor
  • save it as Application and put it in the Dock
  • drag a picture File (size >= 1024) to the Icon in the Dock and it makes Pictures with different sizes.
  • drag the new Pictures to Xojo
on open some_items
	repeat with this_item in some_items
		try
			rescale_and_save(this_item)
		end try
	end repeat
end open
to rescale_and_save(this_item)
	tell application "Image Events"
		launch
		-- size 1024
		set the target_width to 1024
		-- open the image file
		set this_image to open this_item
		set typ to this_image's file type
		copy dimensions of this_image to {current_width, current_height}
		if current_width is greater than current_height then
			scale this_image to size target_width
		else
			set the new_height to (current_height * target_width) / current_width
			scale this_image to size new_height
		end if
		tell application "Finder" to set new_item to ¬
			(container of this_item as string) & "1024_" & (name of this_item)
		save this_image in new_item as typ
		-- size 512
		set the target_width to 512
		-- open the image file
		set this_image to open this_item
		set typ to this_image's file type
		copy dimensions of this_image to {current_width, current_height}
		if current_width is greater than current_height then
			scale this_image to size target_width
		else
			set the new_height to (current_height * target_width) / current_width
			scale this_image to size new_height
		end if
		tell application "Finder" to set new_item to ¬
			(container of this_item as string) & "512_" & (name of this_item)
		save this_image in new_item as typ
		-- size 256
		set the target_width to 256
		-- open the image file
		set this_image to open this_item
		set typ to this_image's file type
		copy dimensions of this_image to {current_width, current_height}
		if current_width is greater than current_height then
			scale this_image to size target_width
		else
			set the new_height to (current_height * target_width) / current_width
			scale this_image to size new_height
		end if
		tell application "Finder" to set new_item to ¬
			(container of this_item as string) & "256_" & (name of this_item)
		save this_image in new_item as typ
		-- size 128
		set the target_width to 128
		set this_image to open this_item
		set typ to this_image's file type
		copy dimensions of this_image to {current_width, current_height}
		if current_width is greater than current_height then
			scale this_image to size target_width
		else
			set the new_height to (current_height * target_width) / current_width
			scale this_image to size new_height
		end if
		tell application "Finder" to set new_item to ¬
			(container of this_item as string) & "128_" & (name of this_item)
		save this_image in new_item as typ
		-- size 48
		set the target_width to 48
		set this_image to open this_item
		set typ to this_image's file type
		copy dimensions of this_image to {current_width, current_height}
		if current_width is greater than current_height then
			scale this_image to size target_width
		else
			set the new_height to (current_height * target_width) / current_width
			scale this_image to size new_height
		end if
		tell application "Finder" to set new_item to ¬
			(container of this_item as string) & "48_" & (name of this_item)
		save this_image in new_item as typ
		-- size 32
		set the target_width to 32
		set this_image to open this_item
		set typ to this_image's file type
		copy dimensions of this_image to {current_width, current_height}
		if current_width is greater than current_height then
			scale this_image to size target_width
		else
			set the new_height to (current_height * target_width) / current_width
			scale this_image to size new_height
		end if
		tell application "Finder" to set new_item to ¬
			(container of this_item as string) & "32_" & (name of this_item)
		save this_image in new_item as typ
		-- size 16
		set the target_width to 16
		set this_image to open this_item
		set typ to this_image's file type
		copy dimensions of this_image to {current_width, current_height}
		if current_width is greater than current_height then
			scale this_image to size target_width
		else
			set the new_height to (current_height * target_width) / current_width
			scale this_image to size new_height
		end if
		tell application "Finder" to set new_item to ¬
			(container of this_item as string) & "16_" & (name of this_item)
		save this_image in new_item as typ
	end tell
end rescale_and_save

Thanks Axel,

What do you mean by “drag the new Pictures to Xojo”?

Do you mean …

  1. Go To “File Types”
  2. Click on the appropriate extension
  3. Click on the icon Imagewell
  4. Apply the appropriate size image to its corresponding Imagewell ?

Thanks again.

Lennox

yes, in App Icon or in FileTypes Window

Last time I dropped an icns file int the above window, it worked only for the 1024 x 1024 size…

Also, for better results, drop files with the size you want to get… *

So drop a 512 x 512 image into the 512 entry above (and so on): you will get better results.

Just like what is shown in the image above, I checked only in the Vorchau view (I didn’t checked the Masken).

I am quite sure the above window is able to resize the image at the desired size, but the result may not be as nice as your own size. I think that I drag and drop a 1024 x1024 into the 512 and lower sizes (for testings).

I re-read Lennox original message and found that… I have the exact inverse:

Yosemite: The large icons are displayed at window’s open time, then replaced by the generic ones, but in view by list, I get my custon icons… go figure.

I have to many worries to work against to check now what’s the situation on El Capitan…

[Mavericks: the icon of the application itself is not shown: at last, I make a copy/paste… and so the user can click in it]