Q: AppleScript, terminal, and files with spaces
Hey all, I was writing a little program to move files around with the do script action. I ran into an issue with files that have spaces. Applescript freaks out a bit when I use the terminal command "touch ~/Desktop/Hello\ World". Is there a work around for this?
tell application "Terminal" do script "touch ~/Desktop/Hello\ World" end tell
MacBook Pro with Retina display, OS X El Capitan (10.11.3), Dvorak Keyboard Layout
Posted on Feb 2, 2016 5:33 PM
by red_menace,Solvedanswer
Desktops
The backslash is used as an escape character, so it also needs to be escaped:
do script "touch ~/Desktop/Hello\\ World"
Posted on Feb 2, 2016 5:51 PM
