How to obtain the number of hydrogen bonds ??

My trajectory is summarized as follows. (Materials Studio 5.5)

1. Amorphous Cell Construction w/PBC (binary mixture : polymer + solvent)

2. NVT 1000ps (produce .xtd file)

Some papers calculated the number of hydrogen bonds between the specified atoms.

For example, H-bonds of (O atom of polymer + H atom of solvent)

Reference : Jovan Mijovic and Hua Zhang, J. Phys. Chem. B 108, 2557-2563 (2004)

I understand how to view hydrogen bonds graphically on the screen (using two criteria : acceptor-H length and acceptor-H-donor angle),

but I would like to generate the number of these interactions.

I found the related script of Stephen Todd,

but I cannot apply this script to my work because I'm not good at script handling.

Help me please.

Kind regards,

Suk Yung Oh