I don't know any way how to use the API without putting it in a dll or ActiveX...
I don't think there is a way to do that... but perhaps someone else knows...
Edit: @Deco, if you have a different question than the one the topicstarter has, please open another thread, and since it's a question about the API you should post it in the plug-in forum...
And you can do this very easy with a script....