home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-24 | 2.6 KB | 68 lines | [TEXT/MPS ] |
- Writing custom packaging options for MacPerl Matthias Neeracher 24Nov94
-
- Often, to be able to conveniently use MacPerl scripts to do a job, it helps
- to combine them with some glue code - e.g., for droplets. Starting with version
- 4.1.4, it is now possible to add custom packaging options to MacPerl. This file
- describes how to specify them and their effects.
-
- FORMAT OF MACPERL FILES
-
- Every file saved by MacPerl 4.1.4 contains the following resources (most of these
- were also present in earlier versions):
-
- 'TEXT' (128, "!") The script itself, unless the file is a plain text file, in which
- case the script will be saved in the resource fork.
- 'MrPL' (128) The package ID. Currently defined package IDs are:
- 'TEXT' A plain text file.
- 'SCPT' A droplet.
- 'MrP7' A system 7 runtime.
- 'MrP6' A universal runtime.
- 'WWWΩ' A MacHTTP CGI file.
-
- 'TFSP' (255) The printing setup for the file.
- 'TFSS' (255) The font, size and rectangle for the file.
- 'STR ' (-16396) The application name ("MacPerl")
-
- Optionally:
-
- 'McPo' (128) A list of entries for all resources belonging to the packaging.
- These resources may be erased or overridden with each save.
- 'McPo' (129) A list of entries for all resources that may not be overridden
- under any circumstances. The format of both lists is:
- 4 bytes Resource type
- 2 bytes Resource ID
-
- The list is terminated by a (0,0) tuple.
-
- PACKAGING OPTION DESCRIPTIONS
-
- A packaging option is contained in a file of type 'McPp', creator 'McPL' contained
- in a folder "MacPerl Extensions" in either the MacPerl application folder or the
- Extensions folder. The following resources are required:
-
- 'STR ' (32700) The name of the packaging option to appear in the Save As… popup
- menu.
- 'McPp' (32700) A packaging resource, consisting of
- 4 bytes version number, currently '0100'
- 4 bytes a package ID. To guarantee uniqueness, please register package
- IDs with me <neeri@iis.ee.ethz.ch>.
- 4 bytes file type for script
- 4 bytes file creator for script
- 4 bytes flags. Currently only the two high order bits are defined:
-
- Bit 31:
- 1 Set bundle bit of created file
- 0 Clear bundle bit
-
- Bit 30:
- 1 Set custom icon bit of created file
- 0 Clear custom bit
-
- 'McPs' (32700) A shopping list enumerating the resources to add to the saved file.
- This is a list of entries, each consisting of:
- 4 bytes Resource type in package file
- 4 bytes Resource type in saved file
- 2 bytes Resource id in package file
- 2 bytes Resource id in saved file
-
- This list has to be terminated by a (0,0,0,0) entry.