List Filter access

Is it possible (other than calling the actual .plist file with os commands) to access List Filters via code?

What do you like to do? Do you like to check what filters are in the list? Or select them?

My plan is to select one from the given list filters, and run a certain script just over the members of that filter. I want to do this with a list filter, rather than an instant selection of glyphs, because the list filters can be saved, reviewed and changed easier than plain glyph selection.

Hey,

Sorry for reviving this thread, but is this possible yet?
Or any news on an implementation?

Sorry for reviving this thread, again; Is it yet possible to access or define list filters via scripting? This would be very useful.

from Foundation import NSMutableDictionary
newListFilter = NSMutableDictionary.dictionaryWithObjectsAndKeys_(
	True, "isLeaf",
	"Test", "name",
	["a","b","c","adieresis"], "list",
	"CustomFilterListTemplate", "icon",
	None)

filterController = Font.fontView.glyphsGroupViewController()
glyphGroups = filterController.glyphGroups()[2]["subGroup"]
glyphGroups.append(newListFilter)
filterController.saveCustomFilters()

(Thanks Rainer for the suggestion)

2 Likes

Sorry for reviving this thread
Georg solution is what Rob wanted. Great!
What about Mark? He said: list already there, access members of list via script.
My additional wish: add scripts to the font view menu (that click right menu) and the script ONLY effects the glyphs currently shown in the font view…

:slight_smile:

The script can easily decide for itself what it likes to do :wink:

The above script should give you all you need to access the filters:

filterController = Font.fontView.glyphsGroupViewController()
glyphGroups = filterController.glyphGroups()[2]["subGroup"]
print glyphGroups