Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use osascript and system events via SSH to control GUI Network
Sometimes Timbuktu crashes and I restart it using SSH:
$ sudo kill -9 PID_for_timbuktu_host
$ open -a Timbuktu\ Pro.app
That usually works because the app starts the host again. But maybe you need to fix something, and you don't have access to a Timbuktu-enabled machine; just SSH. You can use osascript to call System Events to trigger menu actions, keystrokes, and dialog box navigation all via SSH. Just use the open -a shell command to get the application you want to have open to open and become frontmost, then send it osascript with System Events commands. It's kind of like driving while blindfolded, so be careful! It helps to have a local system with a similar setup, so you can test the osascript command before you run it "blind." Or better yet, work out your osa GUI control scripts while you watch via Apple Remote Desktop (ARD), VNC or Timbuktu. Here's a trivial example:
$ open -a Stickies.app ; osascript -e 'tell application "system events"' \
  -e 'keystroke "n" using command down' -e 'keystroke "Wow!"' -e 'end tell'
I use this technique to deal with some password dialog box issues in using a FilemakerPro setup. Sometimes the FMPro database won't start up without a password and it blocks everything else with its pesky dialog box. I can use this little script technique to just spit the password into the dialog box as if I were sitting there (or at an ARD, VNC or Timbuktu screen).
    •    
  • Currently 3.25 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[14,306 views]  

Use osascript and system events via SSH to control GUI | 1 comments | Create New Account
Click here to return to the 'Use osascript and system events via SSH to control GUI' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use osascript and system events via SSH to control GUI
Authored by: macshome on Dec 15, '04 11:08:24AM

For Filemaker you can always set the document prefs to try a default password first...



[ Reply to This | # ]