0

I need to write an applescript to hide and unhide specific files. This is what I have so far, but apparently the spaces in the file name is causing problems.

tell application "System Events"
    do shell script "chflags nohidden "/VOLUMES/Works/who/3130026 - Why Onspots.pdf""
end tell

Not sure what I'm doing wrong. Thanks in advance for the help.

Sharky
  • 13
  • 2
  • For file paths, best is to use the "quoted form of ", like this: do shell script "chflags nohidden " & quoted form of "/VOLUMES/Works/who/3130026 - Why Onspots.pdf" –  May 27 '15 at 06:37

1 Answers1

0

You need to escape the quotes inside the shell command, using the backslash '\' character, like so

do shell script "chflags nohidden \"/VOLUMES/Works/who/3130026 - Why Onspots.pdf\""
kabiroberai
  • 2,930
  • 19
  • 34
  • 1
    @Sharky: you should really check off his answer as answered then. (Just click on the number thing to the left of the question. – McUsr May 27 '15 at 06:40