Prompt for IP

I’m still working on this music deployment app using xcode and interface builder and cant figure out how to have Applescript prompt me for an IP address and input it into a shell script

The script right now requires you put in the ip address of the client, but i would love it if when i ran the script it prompted me for an IP and input it to what you see below.

do shell script "rsync -a -e ssh --delete ~/Music/itunes/ music@"
do shell script "ssh music@ killall iTunes"
do shell script "ssh music@ ~/Desktop/"

ps i’m a noob and would really appreciate your help

  1. Take a few minutes and this post first, regarding the use of shell commands:

  1. You just have to capture the IP or hostname in whatever variable you wish:
set remoteHostByIP to text returned of (display dialog "Please enter the hostname or IP of the computer to which you wish to connect:" buttons {"Cancel","Connect"} default button "Connect" default answer "") as Unicode text

do shell script "/usr/bin/rsync -a -e ssh --delete ~/Music/itunes/ music@" & remoteHostByIP & ":~/Music/itunes/"
-- etc, etc

Thank you Mikey-San. It works great :smiley: