Copy File Applescript fails when blank in file name

Discussion in 'Mac Apps and Mac App Store' started by WaywardActor, Feb 27, 2015.

  1. WaywardActor macrumors newbie

    Feb 27, 2015
    I'm trying to write an Applescript that will get finder to copy a file from one directory to another. It works for "normal" file names. However, when I use a filename that has a blank in the name, it fails. The message is

    Finder got an error: Can’t set folder "Macintosh HD:Users:FrederickOchs:Church:photos:Deleted Scans" to file "Macintosh HD:Users:FrederickOchs:Church:photos:Scans:VW0000 3.jpeg".

    The script is

    tell application "Finder"
    copy file "Macintosh HD:Users:FrederickOchs:Church:photos:Scans:VW0000 3.jpeg" to folder "Macintosh HD:Users:FrederickOchs:Church:photos:Deleted Scans"
    end tell

    Is there a way to get this to work?
  2. WaywardActor thread starter macrumors newbie

    Feb 27, 2015
    My mistake

    My mistake. The script does work. I apologize.

Share This Page