Importing metrics doesn't work

Hi,
if i understood it right you could import metrics from another file .glyphs/.UFO .
I created a new file with only one square at ‘A’. Then dublicated the file and set some different sidebearings to my ‘A’ saved it and tried to import the metrics to my first file.
What happens: exactly nothing.

Is this a bug?

Because I have downloaded several scripts from the gitHub and runned them all of them will show the same error but in a different line. like for example:

Start
File “CenterGlyphs.py”, line 18
Doc = Glyphs.currentDocument
^
IndentationError: expected an indented block
End

Someone an idea?
Sys: OSX 10.9.2 and Glyphs Version 1.4.3

How do you import metrics? Can you describe the steps?

Which scripts did you download?

I tried to import via
file > import > metrics
an then, as i said, choose a different .glyphs file.

I downloaded this one:
https://github.com/schriftgestalt/Glyphs-Scripts/blob/master/Metrics%20%26%20Classes/ Center%20Glyphs.py

The Metrics import seems to be broken indeed. Try the Steal Sidebearings script from my Github repository:
https://github.com/mekkablue/Glyphs-Scripts
(needs Vanilla, the installation of which is described in the Readme)

Center Glyphs.py, however, works as expected for me. The error message you quote says that line 18 is not indented. But in the file that your link points to, it is. How did you install the script?

Centre Glyphs by Georg seems to do a different thing by the way. Mekkablue version seems more reliable.

They both do the same thing: save the original width, calculate the average of LSB and RSB, set the LSB to the average, and reapply the original width.

The import metrics function is only applied to the selected glyphs. So if you have not select anything, nothing happens.

@mekkablue thanks, “Steal Sidebearings” works. very cool. And installing Vanilla works easy as f***, great.

@Georg Seifert sorry, i have tried selecting one glyph, whole set, no glyph - result is always the same: nothing.
Don’t get me wrong Georg, i love Glyphs App and its power and simpleness to use and i really appreciate how much time you spend for support and improvement, your work is awesome, keep that on.

Maybe i was too stupid to install the scripts right. :wink:
Now i got it.

For all who have problems with installing from gitHub too, it works like this:
If you got the script you want, click to the ‘RAW’ tab and simply safe the file in the directory which opens if you choose ‘Scripts > Open Scripts Folder’ in GlyphsApp.

Bad idea. Download the whole repository zip, or even better, clone with the GitHub app.

Ok.?!
Well, that worked for me, but you’re the scriptmaster :slight_smile:

Thnx.