@Fatma_al_abyad Try to use figma console mcp will do 90% from this job (maybe 100%)
Select target frame -> then open terminal and use this prompt:
Apply appropriate variables from attached library on all nested layers of the selected frame.
make sure to select the frame.