Is it possible to copy to all selected glyphs?

I’m working on a devanagari font. For proofing purposes I would like to generate the entire font from a custom list filter and fill all of the undesigned glyphs with .notdef. Is there a way to paste the same glyph into all selected glyphs? If not, does anybody have a script for adding a component to all selected glyphs?

Will a simple rectangle do too?

There is a script called Fill up with rectangles in my repository.

A rectangle will do fine. Thanks!

You could also use LayerGeek with addComponent_(GSComponent(".notdef"))

But I found this solution to be unstable in Glyphs2. No problems in 1.4.4.

Fill up with rectangles doesn’t work for me.

In 1.4.4 I get the following error:
Traceback (most recent call last):
File “Fill Up with”, line 54, in
File “Fill Up with”, line 36, in process
File “/Users/jamespuckett/Library/Application Support/Glyphs/Scripts/”, line 22, in len
return len(self.values())
TypeError: object of type ‘NoneType’ has no len()

In 2 I get:
Filling A: not empty, skipped.

Any suggestions?

Means you only selected the A before you ran the script, and since it was not empty, it didn't put anything in it. Select all glyphs, and run the script.

As for the 1.4.4 error, please delete this file: /Users/jamespuckett/Library/Application Support/Glyphs/Scripts/"

I think that this may be a Glyphs 2 bug. If I use a list filter to generate a batch of Glyphs all those glyphs are selected after being generated. In Glyphs 2 all those glyphs are selected, but the script runs as if they are not. But if open an edit tab and then go back to the font tab the script will run as if the Glyphs are selected.
Hmm I thought I was able to reproduce this at first, but now it looks like I was mistaking other colourings (like the 'unsaved changes' indicator) for selections. I will keep testing and observing.

I have a suspicion that it may have something to do with the order of the glyphs in the list filter, and whether the newly generated glyphs are at the beginning, at the end, or interrupted by previously generated glyphs. But I could not confirm this yet.

what happens if you run this script in the macro panel after you generated the glyphs:

for l in Font.selectedLayers: