When i try to do a shell script within an apple script, if there is a space in a name of a folder or file i know that the shell script will not like this if i put a \ before the space like in the termianl the applescript dose not like the \ in the file path. How do i get around this??
do shell script “ditto ~/Documents/my\ projects/ /backup\ server/backups”
“Quoted form” would be the proper way to handle this:
get POSIX path of ((path to documents folder as Unicode text) & "my projects:")
do shell script "ditto " & quoted form of result & space & quoted form of "/backup server/backups"
“Quoted form of” tends to not work; I constantly get “file or folder not found” errors when using it even though the path is 100% correct. Removing “quoted form of” and using double backslashes fixes the problem (annoying as doing that is), so I recommend that method.