Is there a way to launch ScreenSharing from the Terminal?
Solution 1:
open vnc://server.address[:port]
Solution 2:
If you have access for assistive devices activated in System Preferences, you can try saving the following AppleScript in AppleScript Editor and executing it via command line:
tell application "Screen Sharing"
activate # start Screen Sharing if not running yet
tell application "System Events"
keystroke "a" using command down # this will cause the address to clear
keystroke "127.0.0.1" # replace with your host
key code 36 # press enter
end tell
end tell
Save as Sharing.scpt
, and execute as osascript /path/to/Sharing.scpt
.