Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

how to resize a screen share using applescript in 10.8?

Hello,

I am trying to screen share on to 10 mini mac servers and then resize each window.


----I have got this script to work as a test between macbook pros using 10.6/10.7


tell application "Screen Sharing"

open location "eppc://username:password@.Mac1.local"

activate

end tell


delay 3


tell application "Screen Sharing"

activate

set the bounds of the front window to {10, 220, 517, 531}

end tell


delay 3


tell application "Screen Sharing"

open location "eppc://username:password@.Mac2.local"

activate

end tell


delay 3


tell application "Screen Sharing"

activate

set the bounds of the front window to {10, 467, 517, 782}

end tell


etcetc


----however I can not get it to work across the 10 mini macs I need to screen share. They are running 10.8.

---- I have managed to get the 10.8 mini macs to understand:


tell application "Screen Sharing"

open "vnc://Mac1.local"

activate

end tell


delay 3


---- (I could not get them to screenshare using "eppc://username:password@.MacNumber.local" or "vnc://username:password@.MacName.local" so they now log in automatically as they have the username and password remembered in the keychain) however I am strugling to get 10.8 to understand resizing the screen share windows using the bellow code:


tell application "Screen Sharing"

activate

set the bounds of the front window to {10, 467, 517, 782}

end tell


----If anyone has any suggestions, that would be ace and much appreciated !


Thanks

OS X Mountain Lion (10.8.4)

Posted on Sep 7, 2013 10:03 AM

Reply
1 reply

Jun 6, 2014 10:08 AM in response to Zebrajeans

Well, this is kind of old, but I wanted to share my solution to this problem: You have to tell System Events to tell the Screen Sharing process to move the windows. I atleat got this to work with 3 Screen Sharing windows. The fourth won't resize correctly - the fifth won't even position right. Have to figure that out.


set _clients to {"vnc://localhost:59208", "vnc://localhost:59207", "vnc://localhost:59106", "vnc://localhost:59107", "vnc://localhost:59000"} set _size to {718, 258} set _positions to {{-1440, 620}, {-720, 620}, {-720, 880}, {-1440, 880}, {-1082, 137}} repeat with i from 1 to count of _clients      tell application "Screen Sharing"           GetURL item i of _clients           activate           delay 2           tell application "System Events"                set the position of the first window of the application process "Screen Sharing" to item i of _positions                set the size of the first window of application process "Screen Sharing" to _size                end tell           delay 2      end tell end repeat


Hope that helps.

how to resize a screen share using applescript in 10.8?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.