I'm using the following command to get a mount point from a disk:
do shell script "diskutil info /dev/disk4s1 | sed -n 's/.*Mount Point: *//p'"
however if I have two disks with the same name it returns the second one as something like this:
"/Volumes/myDisk 1"
I would like to get the following output:
"/Volumes/myDisk\\ 1"
how can i do this using Applescript-objc?
quoted form of.| sed 's/ /\\\\\\\\ /g'to the end of the shell pipeline. Yes, that's eight backslashes, because AppleScript will interprets them (effectively removing half of them) before passing them to the shell, the shell leaves them alone because they're in single-quotes, but thensedruns them through another layer of interpretation-and-removal, halving the number again... so you need to start with four backslashes for every one you want to come out at the end.