In Parallels Desktop 8 or 9, I used an AppleScript to set the size of the window to a standard size (important for testing/documenting the GUI on a Windows app). When I create a screenshot, it needs to match the target resolution (e.g., 1366 x 768). To be clear, I'm not trying to size it to match my Apple monitors, but I am trying to emulate a Windows laptop with a much smaller screen. I need to resize the VM window to some exact sizes. Just created a Windows 10 VM last night with Parallels Desktop 10 on Yosemite, and my trusty script failed. Acts as though the VM windows are not scriptable anymore. I get a "Can't get bounds of window" error (-1728). The Parallels Desktop Control Center window is sizable, but the VM window is not. Is there another way to accomplish my goal of sizing the window to a particular size, without trial-n-error of screenshots and manual shrinking/expanding the size of the window? Below is my script that used to work (and yes, I changed the title to "Windows 10"). set appWindow to "Parallels Desktop" tell application "Parallels Desktop" to get the bounds of the window 1 tell application "Parallels Desktop" set bounds of the window 1 to {1, 1, 1366, 768} end tell
Hi Sonicd, We understand that you're unable to set standard size for Windows Virtual Machine by using Apple Script which was working with previous versions of Parallels Desktop. We've found this solution online for the issue you have encountered, please check if you have the System Preferences > Accessibility preference for "Enable access for assistive devices" set. For more information, you can refer http://stackoverflow.com/questions/...he-window-size-of-some-apps-using-applescript and then check how it works. Please feel free to reach us anytime, we're here to help you.
BLUF: Accessibility functions were disabled in my OS and my script in the original post had an implicit dependency on accessibility functions. Bad error message. Bad! I had to translate the instructions cited by Manoj D. to Yosemite (Stackoverflow post was from 2012): Go to System Preferences > Security and Privacy > Privacy Tab and allow Script Editor to "control [my] computer." Now the script works and I can resize Parallels windows as I need. I had no idea that my AppleScript required accessibility functions. Further. I would have never guessed checking the Security and Privacy icon. Thank you, Manoj!