How to find the full path for finder overlay icon in icon view?

314 Views Asked by At

I'm using simbl plugins to add overlay icon in finder like this: finder overlay icon

The problem is: I can not find the right way to get the file's full path in override function: FO_drawImage in IKImageBrowserCell, I only get a title.

   - (void)FO_drawImage:(id)fp8
    {
        NSString *title = [self previewItemTitle];
        if ([[title lowercaseString] hasPrefix:@"a"])

    {
        NSImage *icon = [fp8 _nsImage];

        NSRect frame = [self imageFrame];
        NSLog(@"drawing width %.0f for name '%@' icon %@",frame.size.width,title,icon);
        [icon lockFocus];
        CGContextRef myContext = [[NSGraphicsContext currentContext] graphicsPort];
        CGContextSetRGBFillColor (myContext, 1, 0, 0, 1);
        CGContextFillEllipseInRect(myContext, CGRectMake (0, 0, 10, 10 ));
        [icon unlockFocus];
        [self FO_drawImage:[[[IKImageWrapper alloc] initWithNSImage:icon] autorelease]];

    } else {
        [self FO_drawImage:fp8];
    }
}
1

There are 1 best solutions below

0
Orbitus007 On
NSURL *item_url = [self previewItemURL];

that should cover it on MacOSX 10.7