Enabler Maker 1.0.3

What is an Enabler
An Enaber makes it possible to get a reference to files which are embeddet in other applications (than the Finder) and to show these files in Informator. This makes it possible to get a direct access to embedded files in layout applications, for example. The Enabler also enables Informator to float over all other windows in these applications.
Some Enablers are contained in the Informator package. These can also be found in the folder "Enabler" in the "Enabler Maker" package.
You can easily create your own Enabler


Create an Enabler

Suppositions
1. The target application has to be scriptable and the reference or path to an embedded file has to be available.
2. You should be experienced with AppleScript

How to do it
The easiest way to create a new Enabler is to modify an existing Enabler. To do this, drop an Enabler to the EnablerMaker window or choose "Open" to open one.

Enter the four character creator signature of the target application to the "Creator Code" field or drop the application to that field to enter the signature automatically.

Now you have to enter AppleScript code to the field "Apple Script Source Code". You can compile and debug your code here in this field as used in Script Editor. You can also debug your code in Script Editor and put it in this field later.

AppleScript Code
You should pay attention to a few things:
1. Timeout
Don't forget to set a Timeout-Block, to prevent Informator from "blocking", if the target application does not respond.
2. Try
Always use a try block. This suppresses error messages and speeds up execution.
3. Error numbers
Return error numbers (look at the examples). This is not explicitly necessary, because Informator does not react on an invalid script return, but it speeds up execution and gives Informator the opportunity to show matching error messages.
4. Returned Path
The script return needs to be a valid path (e.g. "Mac HD:Docoments:Picture 1" or a pathlist separated with "Return", "-", "-", "Return" (see examples).

We can not give you any advice how to get the actual selection and/or the path, because this procedure differs from one application to another. The example Enablers which come with this package, could give you a good starting point, because they all work in different ways.

You can get AppleScript help from the Apple mailinglists ( http://www.lists.apple.com/mailman/listinfo/applescript-users) If you have special questions, maybe we can help you, too. (support@End-If.de)

Activate the Enabler
Save your compiled Scriptcode with a new name in the folder "Enabler" in the Informator folder.
If Informator is running, reload the Enablers with the function "Reload Enablers" in the popup menu in the upper right in the Informator main window.

If you have enabled "Enabler Messages on" in the same menu, Informator sends debugger messages to the console, which could help you finding any bug.

Please send your new Enabler to End If Software. We would like to publish it on our website together with Informator.

Error Codes for Informator
You should return these codes, so Informator can display the correct message
-900007 Unknown error
-900008 No selection
-900009 Timeout error - the application is busy
-900043 File not found - the file with the given path could not be found
-900100 No valid file reference - eg the picture has no reference to a file
-900200 Enabler disabled - the Enabler has been disabled because of an compile error