Assign Image Template property to a .xojo_image file?

Is there a way to assign the Template property to a .xojo_image file So that I don’r need to duplicate my icon images?

I’ve tried using a couple of MBS tricks, but no luck.

You mean this?


I’m pretty sure Xojo doesn’t support templates yet. Since you’re using MBS you can construct a NSImageMBS from a Picture. If you hold Option on Mac when you drag an image from the Desktop to the Navigator it will import as a Picture instead of an ImageSet. You should be able to use the implicit ImageSet to Picture conversion, but I can’t say I’ve ever tried.

Sample code for turning a picture into a template can be found in the MBS documentation:
NSImageMBS Constructor accepting a Picture
NSImageMBS.isTemplate = true

Thanks, Tim - that’s where I originally went, but adding the labeled NSImages as pictures to the image set appears to remove the Template value.

@Christian_Schmitz - any thoughts on accomplishing this? I’d rather not have to convert 132 icon images in Photoshop if I don’t have to …

Create the NSImageMBS instance from a picture and then set the isTemplate property.

I’ve had success doing this many times, creating several NSStatusItem applications that automagically handle dark mode and modern toolbars like you’ll find in the preferences windows of Lifeboat and VersionTracker.


Wait… what? What does this mean? What are you actually trying to do?

The template flag is nothing Photoshop could do.

And a template is often a PDF actually.

The photoshop is because that is what I would use to duplicate all of my Black line art icons as white for the Dark/Light shift in the app.

But, it’s a moot point now sense my need crosses all 3 desktop platforms.