Plug-in Tutorial
|
Telling AEP what a plug-in doesTo be able to do anything with a file extension, AEP needs to have the appropriate plug-in. How does it know which plug-in to call? If you've been snooping around, you might have noticed that in AEP's folder there is another folder called plug-ins. Inside of that, there are three other folder: one for plug-ins that deal with file extensions that are added to a file or folder, one for plug-ins that deal with file extensions that are removed from a file and one for plug-ins that deal with the substitution of file extensions and take care of the translation of files. When a new plug-in in installed AEP sees in which folder this has been done, and so knows whether the plug-in deals with adding, removing or translation. It then asks the plug-in to provide some information, so AEP will know what the plug-in does. (For those of you who want to know: AEP loads the plug-ins as script objects and runs them when it needs to. So when writing plug-ins, you should take care to make them as short as possible, so AEP can load them quickly.) This function is the first item of a plug-in and is calledWhatDoYouHandle. The three types of plug-in have different functions, we will deal with them in turn.
When you write a plug-in for removing file extensions. The template provides the following
If you know nothing of Applescript, don't be concerned. If you do, you don't need me to tell you what's in here. The important point at this time is, that you should open a copy of this template and have it ready. It might also be wise, to save it now with a usefull name like Nutcase Gzip, so you will know what the plug-in is for.
As you want to write a plug-in that deals with the file extension
Because you only deal with one file extension in this plug-in, you can delete the third line. If you needed to add another extension, you would chang the And that takes care of the first step. Save your plug-in. The function should look something like this.
|