Short: MIME filetype generator for Ambient Author: Wizardry and Steamworks Uploader: "Wizardry and Steamworks" Type: util/wb Version: 1.0 Replaces: util/wb/Magic2Morph.lha Architecture: ppc-morphos URL: https://grimore.org/amiga/morphos/magic2morph -:[ About ]:- This is a tool that can generate MIME files definitions that are required by Ambient to identify files in order to attribute various menu and default actions to the files when the user interacts with them from the Ambient window manager on MorphOS. -:[ Files ]:- The "c/" sub-directory should include the compiled Magic2Morph utility. The "Install" icon will install Magic2Morph in C: and a database Magic2Morph.template in ENVARC: -:[ Usage ]:- Existing filetypes typically reside in SYS:Prefs/Ambient/filetypes and can be accessed using Ambient itself by accessing the MIME configuration panel at Desktop -> (Right Click) -> Ambient Settings -> Mime Magic2Morph can then be invoked with, say: Magic2Morph Games:CaptainBlood/CaptainBlood.Slave NAME "WHDLoad slave" which will outut a MIME filetype definition. Note that a name is required and the name represents an anchor for files that will be matched using this filetype. In this example, the filetype definition will match all WHDLoad slave files such that the name is intuitively "WHDLoad slave". If everything looks okay, issue the command again with an output file path, for example: Magic2Morph Games:CaptainBlood/CaptainBlood.Slave NAME "WHDLoad slave" OUTPUT RAM:x-whdload-slave and now the file at RAM:x-whdload-slave will contain the filetype definition. Next, copy RAM:x-whdload-slave to SYS:Prefs/Ambient/filetypes/ under some directory: * text - for files containing readable characters, * image - for picture formats, * audio - for sound files, * video - for video files, * application - for executable and binary files Finally, open Desktop -> (Right Click) -> Ambient Settings -> Mime and search for your filetype, in this case, that would be x-whdload-slave. The filetype definition can then be modified in order to attribute actions to the file type. -:[ Advanced Usage ]:- Note that using the file extension is fairly sane enough for a filesystem where the data exists locally and that the MIME specification was meant for Internet resources when the file type is not previous known. With that said MIME is a superset, or, a means to all ends, and is very powerful in terms of matcaing such that it is possible to accidentally generate false match positivies if the BINARY string is too common between the various files. For example, assume that Magic2Morph is invoked with: Magic2Morph MODE=BINARY README NAME "THIS README FILE!" the command will extract the first four bytes from this document and then match every file that contains these bytes at offset zero which is very cool but definitely not too useful, as immediately apparent. :-) It is a good idea to stick to the default MODE=EXTENSION and iff. the file type to detect is a very particular file type, like, say, a database file, only then use MODE=BINARY for a stronger match. -:[ License ]:- (C) MIT 2026 Wizardry and Steamworks @ https://grimore.org We have a lot of other Amiga/OS code and projects so definitely check us out at https://grimore.org/fuss/amiga or go to https://grimore.org -> SHOW INDEX -> Amiga for various other Amiga stuff created along the years. We have switched to MorphOS out of convenience and to reduce wear & tear to the miggy. All the best to everyone still developing for the Amiga! c(^_^)-/~