Just the same as Emacs scripting and Eclipse plugins. You can do the same with both, but the initial friction of bootstrapping a Plugin Project, declaring this year's flavor of OperationDescriptorFactory, etc. discourages plugins for one-off tasks.
Actually, the last platform I've seen that was ad-hoc scripting friendly was Symbian with PyS60. Now if there was a Firefox phone with a decent camera...