PackageTools

 add attachments to a workbook file

 Calling Sequence AddAttachment( package, file1, file2, directory1, destname=file3, destpath=directory2, ...)

Parameters

 package - string files - (optional) sequence of strings or dest=src string pairs recurse - (optional) truefalse

Description

 • The AddAttachment command adds files to an existing workbook file. If files and/or directories are specified, then they are added to the workbook.
 • To specify a different name or path inside the workbook, specify the files in equation form. When using destname=srcname, the attachment is given the specified destname inside the workbook, but refers to srcname on disk. When specifying only the srcname part, the attachment in the workbook is placed at the root level and given the same filename as the source file.
 • If the srcfile is a directory then all of the files contained therein are added to the workbook. Optionally, you can add the option recurse=true in order to also embed subdirectories.
 • Maple Repositories, or .mla files, are treated as ordinary files by this command.  See PackageTools:-Create for special treatment of unpacking variables once during creation.

Examples

 > $\mathrm{with}\left(\mathrm{PackageTools}\right):$

To add preexisting content from the current directory to an existing workbook, supply additional files as the arguments to the AddAttachment command:

 > $\mathrm{AddAttachment}\left("mypack.maple","page1.mw","page2.mw","variables.mla"\right)$

To customize the titles of any added content:

 > $\mathrm{AddAttachment}\left("mypack.maple","/Intro"="page1.mw","/Chapter 1"="page2.mw","/Images/Thumbnail.jpg"="/mypictures/thumbnail.jpg"\right)$

Compatibility

 • The PackageTools[AddAttachment] command was introduced in Maple 2017.