Autofit object to camera safeframe?

There is a script autofit the object size to camera safeframe dimensions? I was trying to develop using align to camera target and scale, but I failed.
:c