Author Topic: Script for FileCopy not working  (Read 2755 times)

Harvey Kliman

  • Member
  • *
  • Posts: 1
Script for FileCopy not working
« on: February 05, 2011, 09:17:36 AM »
I am a doctor, not a programmer. However, I do manage my own FM db. I am trying to script FileCopy. As easy at it seems to work on paper and with the demo, I appear to be missing something. Here is my script that does not work:

PCFM_FileCopy( filemac:/MacPro 5T/Documents/Writing/Research/EFT DBâ/EFT Report.pdf ; filemac:/MacPro 5T/Documents/Writing/Research/EFT DBâ/EFT Reports/ ; 0 ; Biopsy File::FileCopy new name )

I followed this pattern given by the plugin:

PCFM_FileCopy( SourcePath; DestinationPath; optFlag; optDestFileName )

with the first term being the full pathway to the file to be copied and renamed; the second term being the folder to copy to; the third term being fixed as 0 for the overwrite flag; the last term being a text calculation that renames the file.

Any thoughts on why this is not working? Feel free to email me directly.

Harvey Kliman, MD, PhD
Yale University

Melinda DePalma

  • Member
  • *
  • Posts: 179
    • Productive Computing
Re: Script for FileCopy not working
« Reply #1 on: February 16, 2011, 05:16:54 PM »
The issue appears to be the file path format you are passing to the plug-in, which is "filemac:/MacPro 5T/Documents/Writing/Research/EFT DBâ/EFT Report.pdf" as this is not a valid file path format that the plug-in accepts (although this is the format that FileMaker uses). The path passed to the plug-in should be in one of the the following formats:

1) MountedVolume/path such as /"SomeMacHDName"/MacPro 5T/Documents/Writing/Research/EFT DBâ/EFT Report.pdf
2) Paths can also be user- relative (e.g., ~/Desktop )

If you are unsure as to what path you should be referencing, then please open the FileMaker Demo file and navigate to the File Actions tab, select the "Browse" button under the Source Path option and browse for your file. The path will be listed in the MountedVolume/path format and that is the file path form you should pass to the plug-in.

Hope that helps and please let me know.