I'm having some trouble copying folders into XCode projects with AppleScript. Without Applescript I drag the folder into Xcode.

I've used a similar Applescript handler, as the one shown below, to copy libraries into XCode using "wrapper.library" for the file type. Below I am using "wrapper.folder" to try to copy a folder into XCode and it isn't working.

    on addFolder(fname, fpath)
  tell application "Xcode"
   tell project "Unity-iPhone"
    set my_targets to targets
    set s_target to item 1 of my_targets
    set compile_phase to compile sources phase of s_target
    set link_phase to get link binary with libraries phase of s_target
    tell root group
     set a to make new file reference with properties {full path:fpath & fname, name:fname, file type:"wrapper.folder"}
     add a to link_phase
    end tell
   end tell
  end tell
    end addFolder

Does anyone have any ideas on what I am missing or how to write an Applescript to copy a folder into XCode?

Edit
Report