PackageTools
Create
create a workbook file
Calling Sequence
Parameters
Description
Examples
Compatibility
Create( package )
Create( package, file1, file2, directory1, destname=file3, destpath=directory2, ...)
package
-
string
files
(optional) sequence of strings or dest=src string pairs
recurse
(optional) truefalse
embedmla
The Create command creates an empty workbook file. The filename package should have the extension .maple.
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 will be 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 contain variables and/or procedures, and are treated specially by this command. By default the variables inside a .mla are unpacked from the .mla and stored directly into the workbook file. This process can only be done for a single .mla, and will abort with an error if more .mla files are specified in the calling sequence. To attach .mla files without unpacking them use the option embedmla=false.
with⁡PackageTools:
If no filepath is specified, a new workbook is created in the current directory. Note that the current directory must be writable, otherwise the Create command will not be able to create a new file.
currentdir⁡
Create⁡mypack.maple
To add preexisting content from the current directory to a new workbook, supply additional files as the arguments to the Create command:
Create⁡mypack.maple,page1.mw,page2.mw,variables.mla
To customize the titles of any added content:
Create⁡mypack.maple,/Intro=page1.mw,/Chapter 1=page2.mw,variables.mla,/Images/Thumbnail.jpg=/mypictures/thumbnail.jpg
It is possible to use the Create command to script the creation of package workbooks. In order to make a package workbook that has been built using a script updatable, it is required to set the "X-CloudId" and "X-CloudXId" metadata properties. To set a property of a created workbook, use the SetProperty command:
SetProperty⁡mypack.maple,X-CloudId,1234567890
SetProperty⁡mypack.maple,X-CloudXId,12345
The PackageTools[Create] command was introduced in Maple 2017.
For more information on Maple 2017 changes, see Updates in Maple 2017.
See Also
Creating a New Package Workbook
The Workbook File Format
Download Help Document