Gubaer / josm-scripting-plugin

Task automation in the OpenStreetMap editor JOSM
https://gubaer.github.io/josm-scripting-plugin
GNU General Public License v3.0
26 stars 9 forks source link

How to run utilsplugin2 actions? #109

Closed ypcyc closed 9 months ago

ypcyc commented 9 months ago

How to run menu command "Selection -> Intersecting ways" or "More tools -> Add nodes at intersections" or access JOSM classes directly? https://josm.openstreetmap.de/wiki/Help/Action/SelectIntersectingWays https://josm.openstreetmap.de/wiki/Help/Action/AddNodeIntersection

const NodeWayUtils = Java.type('org.openstreetmap.josm.plugins.utilsplugin2.selection.NodeWayUtils') gives error: TypeError: Access to host class org.openstreetmap.josm.plugins.utilsplugin2.selection.NodeWayUtils is not allowed or does not exist.

const AddIntersectionsAction = Java.type('org.openstreetmap.josm.plugins.utilsplugin2.actions.AddIntersectionsAction') TypeError: Access to host class org.openstreetmap.josm.plugins.utilsplugin2.actions.AddIntersectionsAction is not allowed or does not exist.

https://github.com/JOSM/josm-plugins/blob/498f6617765a13c7455db496ac0b70604f457cd7/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AddIntersectionsAction.java#L33

Gubaer commented 9 months ago

Unfortunately, access to classes from other plugins isn't possible in the current version of the scripting plugin.