How to use External Tool in JOSM?

Is External Tool in JOSM operational? It still has a separate page under Preferences, however documentation indicates it does not exist anymore and I have been unable to make it work.

Would be very useful to start for example a python script or to open a web page with such a tool, including with lat/lon from JOSM.

There is a scripting plugin that will allow you to execute Python code, here is some code that will open an external website in your default browser:

import math
from org.openstreetmap.josm.gui import MainApplication
from org.openstreetmap.josm.tools import OpenBrowser

def getBaseLog(x, y):
  return math.log(y) / math.log(x)

lat = MainApplication.getMap().mapView.getRealBounds().getCenter().lat()
lon = MainApplication.getMap().mapView.getRealBounds().getCenter().lon()
maxLon = MainApplication.getMap().mapView.getRealBounds().getMax().lon()
minLon = MainApplication.getMap().mapView.getRealBounds().getMin().lon()
zoomLevel = getBaseLog(2, 360 / (maxLon - minLon)) + 1
baseurl = "http:/some_website"
url = baseurl + '/@{},{},{}z'.format(lat, lon, zoomLevel)
OpenBrowser.displayUrl(url);
1 Like