Menu

Launch a script on save

xverges
2014-07-30
2014-07-30
  • Volker Börchers

    Hello Xavier,

    there is no special scripting support for registering tasks to execute on special occasions.

    But near the end of MFileManager.save() there is this code:

    final MMapController mapController = (MMapController) Controller.getCurrentModeController().getMapController();
    mapController.fireMapChanged(new MapChangeEvent(this, map, UrlManager.MAP_URL, urlBefore, urlAfter));
    

    So if you register an IMapChangeListener at the MapController it will be executed on save. Unfortunately you have to manually call a script to register the Listener before...

    Regards,
    Volker

     
  • Volker Börchers

    BTW: Anyone interested in startup and shutdown hooks to execute scripts on startup and/or shutdown are invited to suggest a proper API for that.

    Volker