Copy File Action

image\Action_File_Copy_File.jpg

The Copy File action allows a user to copy files from one place to another, especially for copying files from a CD-ROM onto the computers hard disk. For example, you could copy additional word documents or Acrobat files from the CD-ROM by adding this action to a button in your publication.

Setting up the Copy File action:

1. Add the Copy File action to your trigger, as described in adding actions. The Copy File tab will automatically appear when you add the action.

2. Use the Copy this file panel to enter the pathname of the file you want to copy with this action.

 There are four methods of entering a pathname:

(i)  Type the pathname directly into the box.

(ii) Click on the Browse… button to open the Windows Open dialog box to browse for the file on your system – this will put the full pathname in the box for you.

(iii) Click on the Insert Variable button – this will list a number of preset variables that specify particular system locations (e.g. <SYSTEM_CD_DRIVE>.

Note:
The preset variables only show the path and not the name of the file you want to copy. You must add the name of the file you want to copy to the end of the variable name, prefixed with a backslash – see preset variable example for more information.

(iv) Manually type the name of an Opus variable directly into the box – the variable must be surrounded by chevrons (e.g. <usersPathname>). The variable name you type in the box must have been created in your publication.

Note:
You can copy more than one file at a time by using the DOS wildcards in the Copy this file box. For example, to copy all of the files in a folder named myFolder type c:\myFolder\*.* – see DOS Wildcards for more information.

3. Use the To this location panel to enter the pathname where the file should be copied. As with the previous panel in this action, you have the four methods of entering the pathname – see point 2 above.

Note:
If you have previously used the File Browse, Save As Browse or Directory Browse actions in your publication, you can use the variable in which you stored the result of the user’s search in this box.

The copied file can be given a different file type extension (e.g. .doc, .exe, .imp) from the original file, if required.

4. Tick the Overwrite if the file already exists option if you want to replace an existing file in the destination directory that has the same name as the copied file.

Note:
If this option is not ticked, and a file with the same filename already exists in the destination directory, then the original file will NOT be copied to the directory.

Note:
The Read-only attribute is removed from files copied with the Copy File action.

Related Topics:

Understanding Wildcards

Introducing the File Management Actions

Choosing an Action