Make a Package |
Top Previous Next |
If we want to distribute one or more smart objects we can create a package out of them. To create a package we first have to create a package smart object. This javascript file will have only the registry entry and report all items to be inserted in the package.
Example:
function Register() { var meOBJ = new ScriptObject(); meOBJ.name ="Book Package"; meOBJ.uuid ="9DE5AAA5-2373-4EAC-A93B-33EAC116985E"; meOBJ.description="Books Package" ;
meOBJ.type="_package"; //mandatory the type should be package
// here we add all the smart-objects to be inserted in the package meOBJ.AddResource("DAB8E1DE-C05D-420A-8350-F2E1E2D19F42", "Books", PACKAGE_ITEM ); //package item meOBJ.AddResource("7C1D6A96-90E3-423B-977D-2A81B49DAE99", "Reviews", PACKAGE_ITEM ); //package item
return meOBJ; }
We install the package item as a normal smart-object, select it and recall the make Package command.
A dialog box will report all the related resources that are ready to be inserted in the package, smart-objects, library components, Materials and Textures. If You want to protect your scripts You should insert a password, the scripts will be encripted and only who has the password will be able to edit or modify them. Be sure to save Your password in the password database. When we click on the make Package button a file request will ask for the package name and create a single file with extension *.xpk. Package files (*.xpk) can be installed like normal smart-objects with the Add Script/Package component.
|