Is there a way to something like this?
No, not natively. You could create a function to do that, though.