3

I'd like to get the image files for the constants definied in NSImage.h, like NSImageNameGoRightTemplate for example. I'd like to copy and edit some of them. Does anybody know where those images are located? I'm too stupid to find them on the drive...

marsl
  • 959
  • 1
  • 14
  • 25

2 Answers2

1

I use a category-extension with this array if I want the images:

@implementation NSImage (SystemImages)

+ (NSArray*) systemImages {
    static NSArray *images;

    return images = images ?: ({
        NSMutableArray *imgs = @[].mutableCopy;

        for (id name in @[
            NSImageNameQuickLookTemplate,
            NSImageNameBluetoothTemplate,
            NSImageNameIChatTheaterTemplate,
            NSImageNameSlideshowTemplate,
            NSImageNameActionTemplate,
            NSImageNameSmartBadgeTemplate,
            NSImageNameIconViewTemplate,
            NSImageNameListViewTemplate,
            NSImageNameColumnViewTemplate,
            NSImageNameFlowViewTemplate,
            NSImageNamePathTemplate,
            NSImageNameInvalidDataFreestandingTemplate,
            NSImageNameLockLockedTemplate,
            NSImageNameLockUnlockedTemplate,
            NSImageNameGoRightTemplate,
            NSImageNameGoLeftTemplate,
            NSImageNameRightFacingTriangleTemplate,
            NSImageNameLeftFacingTriangleTemplate,
            NSImageNameAddTemplate,
            NSImageNameRemoveTemplate,
            NSImageNameRevealFreestandingTemplate,
            NSImageNameFollowLinkFreestandingTemplate,
            NSImageNameEnterFullScreenTemplate,
            NSImageNameExitFullScreenTemplate,
            NSImageNameStopProgressTemplate,
            NSImageNameStopProgressFreestandingTemplate,
            NSImageNameRefreshTemplate,
            NSImageNameRefreshFreestandingTemplate,
            NSImageNameBonjour,
            NSImageNameComputer,
            NSImageNameFolderBurnable,
            NSImageNameFolderSmart,
            NSImageNameFolder,
            NSImageNameNetwork,
            NSImageNameDotMac,
            NSImageNameMobileMe,
            NSImageNameMultipleDocuments,
            NSImageNameUserAccounts,
            NSImageNamePreferencesGeneral,
            NSImageNameAdvanced,
            NSImageNameInfo,
            NSImageNameFontPanel,
            NSImageNameColorPanel,
            NSImageNameUser,
            NSImageNameUserGroup,
            NSImageNameEveryone,
            NSImageNameUserGuest,
            NSImageNameMenuOnStateTemplate,
            NSImageNameMenuMixedStateTemplate,
            NSImageNameApplicationIcon,
            NSImageNameTrashEmpty,
            NSImageNameTrashFull,
            NSImageNameHomeTemplate,
            NSImageNameBookmarksTemplate,
            NSImageNameCaution,
            NSImageNameStatusAvailable,
            NSImageNameStatusPartiallyAvailable,
            NSImageNameStatusUnavailable,
            NSImageNameStatusNone
        ])
        {
            [imgs addObject:[NSImage imageNamed:name]];
        }
        imgs.copy;
    });
}

@end
Ky -
  • 30,724
  • 51
  • 192
  • 308
Alex Gray
  • 16,007
  • 9
  • 96
  • 118
  • Why do you add each image 1000 times? Isn't adding it once sufficient? – mah Oct 20 '14 at 13:16
  • 2
    @mah I have no idea... some body-snatcher left that idiotic answer. Here's a slightly less idiotic edit, that is at least an actual category, lol. – Alex Gray Oct 28 '14 at 03:44
1

As far as I know, they are not located in a single place, and their names may not reflect at all the name of the constants.

They can be located in the 'Resources' folder of a framework, like

/System/Library/Frameworks/AppKit.framework/Resources/

or directly in an application, like

/System/Library/CoreServices/Finder.app/Contents/Resources/

You may also take a look at a theming app, like CandyBar. Maybe you'll be able to see some paths in the binary.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Macmade
  • 52,708
  • 13
  • 106
  • 123
  • Thanks for your answer. I found a lot of images in /System/Library/Frameworks/Quartz.framework/Frameworks/ImageKit.framework/Versions/A/Resources. Also there are a lot in the Finder bundle as you proposed. However, I did not find the one I actually was looking for. Maybe they are located in this binary file: /System/Library/PrivateFrameworks/CoreUI.framework//Resources/ArtFile.bin. But can't read it. I'll create my own ones. – marsl Apr 21 '10 at 12:40