Count fields in omniGraffle

Hello everyone, I want to create timetables with OmniGraffle. An Apple script is supposed to help and count the hours of placing cards of a certain color. Unfortunately, I’m a beginner at Apple Script and grateful for any advice. Can the count command help?

Thank you

HI, I´ve found a solution: This works for me.

Thank You