The Removing of an Extension 1

Home

What's new?

Help

Plug-ins

Plug-in Tutorial

  1. introduction
  2. talking to AEP
  3. processing
  4. making it better
  5. another removal
  6. add an extension
  7. some tips

Download

Telling AEP what a plug-in does

To 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 called WhatDoYouHandle. 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 WhatDoYouHandle routine:

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 gz, this is the first thing you should change in the plug-in. On the second line fill in the extensionname by changing the XXX to gz. Take care to keep the double quotes! If you want, and I strongly encourage it, also provide a short description of what the plug-in those. To do that, change the text Very short text to something more meaningfull, like Uses NutCase Gzip to extract a gzip file. Again, keep the double quotes.

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 YYY on that line into the extension. If you want to include still more extensions, just copy this line as often as you need.

And that takes care of the first step. Save your plug-in. The function should look something like this.

When you've rested a bit and feel up to it, you might want to continue with the second part of this tutorial.


A.E.P. The Active Extension Processor - Created by Roger Jolly - Copyright 2002 - All rights reserved.