Assign file type to plugin?

Is it possible to define a file extension as belonging to a Glyphs plugin? I tried adding this to the Info.plist, but it doesn’t seem to have an effect:

<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleDocumentTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string>glyphsToolBox</string>
			</array>
			<key>CFBundleTypeName</key>
			<string>Glyphs ToolBox</string>
			<key>CFBundleTypeOSTypes</key>
			<array>
				<string>glyphsToolBox</string>
			</array>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>LSItemContentTypes</key>
			<array>
				<string>de.kutilek.glyphsToolBox</string>
			</array>
			<key>LSTypeIsPackage</key>
			<false/>
		</dict>
	</array>
	<key>CFBundleExecutable</key>
	<string>plugin</string>
	<key>CFBundleIdentifier</key>
	<string>de.kutilek.GlyphsToolBox</string>
<!-- ... -->

Hm, it seems that this is deprectated since macOS 10.5 :wink: But I don’t find a replacement for it.

I don’t think plugins can extended the set of predefined file extensions of an app; that is more of a macOS limitation.

Maybe there is something we can add in Glyphs directly to facilitate what you want to do. What are you trying to do?

I have a plugin that can save its setting to a file (with user interaction). I just thought it would be neat if the file extension signaled that the file type belongs to Glyphs or to this plugin. I’m not expecting to double-click it so that it will open in my plugin (but hm, maybe users might expect that …)

Do you mean to register a completely new file type or just make the plugin able to open an existing one?
The BDFFileFormat plugin registers its own file type. You should be able to replicate this.