Changes between Version 17 and Version 19 of Help/Plugin/Scripting


Ignore:
Timestamp:
(multiple changes)
Author:
(multiple changes)
Comment:
(multiple changes)

Legend:

Unmodified
Added
Removed
Modified
  • Help/Plugin/Scripting

    v17 v19  
    11[[TranslatedPages]]
    2 = Scripting =
     2= Plugin -> Scripting =
    33
     4[[Image(https://josm.openstreetmap.de/pluginicon/scripting.jar/images/script-engine.png,link=,48)]]
    45[[PageOutline(2-4,,inline)]]
    56
     
    1314* exporting to a custom file format not supported by JOSM
    1415
     16
    1517== How to execute scripts ==
    16 
    1718The [https://gubaer.github.io/josm-scripting-plugin scripting plugin] allows you to run scripts within JOSM.
    1819
    1920You can run scripts from console or from files. If you pick files, then latest scripts will appear in "scripting" menu. See also
    2021
     22
    2123== How to write your own scripts ==
    22 
    2324Please carefully inspect both resources:
    24 * http://gubaer.github.io/josm-scripting-plugin/doc/documentation.html - follow all links here
    25 * http://gubaer.github.io/josm-scripting-plugin/apidoc/modules/josm.html - scan what all classes, modules, mixins and namespaces can do.
     25* https://gubaer.github.io/josm-scripting-plugin/doc/documentation.html - follow all links here
     26* https://gubaer.github.io/josm-scripting-plugin/apidoc/modules/josm.html - scan what all classes, modules, mixins and namespaces can do.
    2627
    2728To write functional scripts than "josm.alert(josm.menu.length);" you should combine examples from multiple pages, for example:
    28 * [http://gubaer.github.io/josm-scripting-plugin/apidoc/classes/JSAction.html Create an action using "JSAction" class], then [http://gubaer.github.io/josm-scripting-plugin/doc/menu.html attach it to menu as was shown at "Extending the JOSM menu and the JOSM toolbar" page]
     29* [https://gubaer.github.io/josm-scripting-plugin/apidoc/classes/JSAction.html Create an action using "JSAction" class], then [https://gubaer.github.io/josm-scripting-plugin/doc/menu.html attach it to menu as was shown at "Extending the JOSM menu and the JOSM toolbar" page]
     30
    2931
    3032== Implementations details ==
    31 
    3233The plugin includes a embedded scripting engine for Javascript based on Mozilla Rhino and a
    3334[https://gubaer.github.io/josm-scripting-plugin/apidoc/modules/josm.html Javascript API] for the JOSM application objects.\\
    3435Alternatively, you can use any scripting language which provides a JSR-223 compatible scripting engine, in particular
    35 [http://groovy.codehaus.org/ Groovy], [http://www.jython.org/ Python], or [http://jruby.org/ Ruby].\\
     36[https://groovy-lang.org/index.html Groovy], [https://www.jython.org/ Python], or [https://www.jruby.org/ Ruby].\\
    3637
    3738[https://github.com/gubaer/josm-scripting-plugin Source code at GitHub].
    3839
     40
    3941== Scripts ==
    4042=== Scripts in JavaScript ===
    41 
    4243* https://gist.github.com/Rub21/feb83f57a727ac0d8a34 - Expand abbreviations (US)
    4344* https://gist.github.com/Rub21/47838797856566a8b6ba - Capitalize names and eliminate "name=S/N"
     
    4546
    4647=== Scripts in Python ===
    47 
    48 * [wiki:Help/Plugin/Scripting/Python] - various small scripts that are meant to illustrate how to do one thing.
    49 * [wiki:Help/Plugin/Scripting/Python/SurfaceTypesOfRoutes] - (Interesting for cycle routes, both loops and linear ones). Short piece of code, but illustrates some interesting concepts and reports on OSM data. Doesn't make changes to the data
    50 * [wiki:Help/Plugin/Scripting/Python/RCN_Route_Validator] - This is not a trivial script anymore. It does a lot in a complicated field (networks of cycle node routes with numbered nodes), makes changes to relations, writes to a file that can be pasted to the wiki. Analyzes routes, but also networks of routes or collections of networks of routes, depending on the selection in JOSM when the script was run.
    51 * [attachment:ticket:7991:AutoAddIntersections.py AutoAddIntersections] (needs [wiki:Plugin/UtilsPlugin2 UtilsPlugin2]) - Adds command queue listener that will perform utilsplugin2's AddNodesAtIntersections command after encountering Extrude command. (See #7991)\\
     48* [wikitr:/Help/Plugin/Scripting/Python] - various small scripts that are meant to illustrate how to do one thing.
     49* [wikitr:/Help/Plugin/Scripting/Python/SurfaceTypesOfRoutes] - (Interesting for cycle routes, both loops and linear ones). Short piece of code, but illustrates some interesting concepts and reports on OSM data. Doesn't make changes to the data
     50* [wikitr:/Help/Plugin/Scripting/Python/RCN_Route_Validator] - This is not a trivial script anymore. It does a lot in a complicated field (networks of cycle node routes with numbered nodes), makes changes to relations, writes to a file that can be pasted to the wiki. Analyzes routes, but also networks of routes or collections of networks of routes, depending on the selection in JOSM when the script was run.
     51* [attachment:ticket:7991:AutoAddIntersections.py AutoAddIntersections] (needs [wikitr:/Help/Plugin/UtilsPlugin2 UtilsPlugin2]) - Adds command queue listener that will perform utilsplugin2's AddNodesAtIntersections command after encountering Extrude command. (See #7991)\\
    5252 Run once per JOSM session.
    5353
     54
    5455== Advanced settings ==
    55 
    5656Search for {{{scripting.}}} substring.
    5757
     58{{{#!comment
    5859== See also ==
    59 * [wiki:/Plugins Plugin Help]
     60}}}
    6061
    6162----
    62 Back to [wiki:/Help Main Help]
     63Back to [wikitr:/Plugins Plugin Help] \\
     64Back to [wikitr:/Help Main Help]