Applescript - Problem with Finder's Dupplicate command

Discussion in 'Mac Programming' started by cmiorio, Mar 18, 2009.

  1. cmiorio macrumors newbie

    Mar 18, 2009
    I want to write an applescript that, when adding a file to a folder, creates a copy of that file at a specific location. I enabled Folder Actions for my folder and assigned it the following script :

    on adding folder items to this_folder after receiving added_items

    say "Script started"

    tell application "Finder"
    duplicate added_items to "/Users/Chris/Desktop/test"
    end tell

    beep 2

    end adding folder items to

    When I add a file to my folder, say "Script started" is executed, but the script stops there. However, if I change "/Users/Chris/Desktop/test" to desktop without anything else, the script works. The script also works if I write duplicate added_items to this_folder

    What's wrong with my folder path???

    I'm running OS 10.5.6
  2. LtRammstein macrumors 6502a


    Jun 20, 2006
    Denver, CO
    You should look into tutorials for proper paths in AppleScript.

Share This Page