People have done it in the past, so you might take a look at the following thread. (The topic Title is a clickable link)
Most people who really need this do end up getting purpose built devices because of some significant safety issues. But those can be very expensive. main safety issues are cool
-
operating smoothly enough in both directions that the glass does not crack
-
having a “bump stop“ feature so that it doesn’t close on someone’s fingers. Or someone looking out through the window. This is a real hazard. Even though you think people would notice, they don’t always if they are just resting their fingers on the edge or if it’s a child.
-
handling the situation where the window is partway open and the power goes out and has been restored. Do you want to make sure that the window understands it’s relative position so it doesn’t try to open or closed too far, either of which can shatter the glass.
So… It definitely can be done. It is most often done with purpose built devices. And purpose built devices are probably much more expensive than you thought they would be.