There are two objects $A$ and $B$ whose mass is $m_A$ and $m_B$, respectively. All other objects has zero mass, and there is no friction.
The whole object is affected by gravitational acceleration $g$, so the acceleration of the whole object $a=\frac{m_Bg}{m_A+m_B}$.
The book says that the spring scale weighs at $\frac{m_Am_Bg}{m_A+m_B}$, which is the net force applied to $m_A$. I don't understand this part. Why is the spring scale only weighing the net force applied to the object being pulled?