• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A (fairly simple?) request from a novice scripter...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A (fairly simple?) request from a novice scripter...


  • Subject: Re: A (fairly simple?) request from a novice scripter...
  • From: Alex Zavatone <email@hidden>
  • Date: Thu, 03 May 2012 16:04:56 -0400

You can send shell scripts to the terminal.

You can enable GUI scripting and tell the terminal to type keys.

Like so:

-- GUI Scripting must be enabled from the Universal Access System Pref
-- Click "Enable access for assistive devices"

tell application "Terminal"
activate
set myDocument to window 1
tell the text of myDocument
set myString to "svnserve -d -r ~/Documents/svn" & return
repeat with myChar in myString
tell application "System Events"
keystroke myChar
end tell
end repeat
end tell
end tell


-- GUI Scripting replaced due to keen insight by Christopher Stone

tell application "Terminal"
activate
set myDocument to window 1
tell the text of myDocument
set myShellString to "svnserve -d -r ~/Documents/svn" & return
do script myShellString in myDocument
end tell
end tell



GUI Scripting is enabled by turning on "Enable access for assistive devices" in the Universal Access System Pref.

Use your newly found powers for the forces of good, Luke.

This means no dubstep.


On May 3, 2012, at 3:45 PM, SCOTT WYANT wrote:

Hello all --

I'm hoping this is the right forum for this question --

I'm trying to control an iTunes library on a MacMini on my home network, to allow editing from a laptop.  The MacMini serves iTunes throughout the house.  In order to complete this project, I need to be able to perform an SSH connection via AppleScript, and my skills are limited, at best.  Can I do this, and if so, how? 

With help and research, I've created an AppleScript to close iTunes, but it appears that i need to use SSH to open it, and I'm trying to wrap that SSH request in a simple AppleScript app.  Thus:

 
1) Open Terminal
2) SSH to the remote server
3) Enter the password
4) Launch iTunes (by inserting "open -a iTunes")
5) Close Terminal

I can, if necessary, eliminate the password from the account so that step 3 goes away.  I think.

Thanks.


Scott Wyant
Information Systems Analysis and Design LLC
310.839.0958
email@hidden
email@hidden
Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users This email sent to email@hidden
References: 
 >A (fairly simple?) request from a novice scripter... (From: SCOTT WYANT <email@hidden>)

  • Prev by Date: A (fairly simple?) request from a novice scripter...
  • Next by Date: Re: A (fairly simple?) request from a novice scripter...
  • Previous by thread: A (fairly simple?) request from a novice scripter...
  • Next by thread: Re: A (fairly simple?) request from a novice scripter...
  • Index(es):
    • Date
    • Thread