Thread: AppleScript issue
09-02-2012, 02:44 PM #1
- Member Since
- Sep 02, 2012
I am fairly new to AppleScript and need some help with the following line:
do shell script "diskutil unmount \"Volumes/" & bob
Bob is the variable of the name of the volume I want to pass to the shell script. No matter how I do it - I cannot get the end of the line correct in terms of quotes.* I get the following error in its current state
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
09-05-2012, 01:47 PM #2
Show the code for how you have set the bob variable, as I'm guessing
that is where the problem is.
09-05-2012, 02:02 PM #3
You need to add a quotation mark at the end.
Pretend bob has a value of external_disc. Let's construct the command now, replacing bob with the value:Code:
do shell script "diskutil unmount \"Volumes/external_disc"
09-05-2012, 02:25 PM #4
As vansmith has eluded too, you have three quotation marks, and also
a backslash before Volumes, that should be a forward slash.
Try something like this.
set myVolume to "bob" do shell script "diskutil unmount /Volumes/" & myVolume
09-05-2012, 02:42 PM #5
The backslash before the second quotation mark may be there on purpose though if he's trying to escape it so as to put the volume path in quotation marks (perhaps the volume name has a space?).
09-05-2012, 02:52 PM #6
That's possible, but he still needs to have forward slash in front of Volumes, to indicate
its off of the root path.
Also I suspect he is building his bob variable as a alias HFS type path, instead of a POSIX
style path, but we'll see.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By Snooky in forum Switcher HangoutReplies: 0Last Post: 10-31-2011, 04:27 PM
By Lex in forum OS X - Apps and GamesReplies: 5Last Post: 03-12-2011, 12:26 AM
By nastyveg in forum OS X - Apps and GamesReplies: 3Last Post: 01-20-2011, 04:31 PM
By angsar in forum OS X - Operating SystemReplies: 0Last Post: 05-29-2010, 06:57 AM
By jmullenberg in forum Internet, Networking, and WirelessReplies: 1Last Post: 06-23-2008, 02:57 PM