# Create List Filter via Script

**URL:** <https://forum.glyphsapp.com/t/create-list-filter-via-script/2134>\
**Category:** Scripting\
**Created:** [April 19, 2015, 1:11pm UTC](https://forum.glyphsapp.com/t/create-list-filter-via-script/2134 "2015-04-19T13:11:26Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![FlorianPircher](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/florianpircher/32/30457_2.png) [@FlorianPircher](https://forum.glyphsapp.com/u/FlorianPircher)\
**Post date:** [December 18, 2024, 9:36am UTC](https://forum.glyphsapp.com/t/create-list-filter-via-script/2134/22 "2024-12-18T09:36:03Z")

</div>

There already is a way for a plugin to participate in Smart Filters, but I think it’s somewhat ill-suited for the use case you are describing. The general idea is that a plugin can vend additional properties on GSGlyph and GSLayer by extending the types (in Objective-C this would be a “Category” but I am sure there is a way to do this from Python as well). Then, you can query those properties using the “Custom” predicate pattern.

For example, I am working on a plugin that vends a `lightTableStatus` property on both GSGlyph and GSLayer. Then, it can be used in a Smart Filter like so:

 ![](https://forum.glyphsapp.com/uploads/default/original/3X/8/6/86b39d84c98f1dbfb95fc1d9e9d61c11c4b69be5.png)

This queries the property on GSGlyph. To access the layer of the currently selected master, you would need to prefix the property with `layer0.` (for example, `layer0.lightTableStatus == 2`).

The glyph order and their section headings will be preserved, but the filtering is all performed using custom code (plus [custom cell drawing](https://forum.glyphsapp.com/t/new-api-draw-in-font-view-glyph-cells/32292), in this case):

 ![](https://forum.glyphsapp.com/uploads/default/original/3X/2/a/2aafece895470a79f73fcc5af9825ac7891a2b07.jpeg)

---

_[View the full topic](https://forum.glyphsapp.com/t/create-list-filter-via-script/2134)._
