{"action":"created","issue":{"url":"https://api.github.com/repos/imagej/imagej/issues/121","repository_url":"https://api.github.com/repos/imagej/imagej","labels_url":"https://api.github.com/repos/imagej/imagej/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/imagej/imagej/issues/121/comments","events_url":"https://api.github.com/repos/imagej/imagej/issues/121/events","html_url":"https://github.com/imagej/imagej/issues/121","id":66721806,"number":121,"title":"Allow passing parameters to scripts","user":{"login":"ctrueden","id":556626,"avatar_url":"https://avatars.githubusercontent.com/u/556626?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrueden","html_url":"https://github.com/ctrueden","followers_url":"https://api.github.com/users/ctrueden/followers","following_url":"https://api.github.com/users/ctrueden/following{/other_user}","gists_url":"https://api.github.com/users/ctrueden/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrueden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrueden/subscriptions","organizations_url":"https://api.github.com/users/ctrueden/orgs","repos_url":"https://api.github.com/users/ctrueden/repos","events_url":"https://api.github.com/users/ctrueden/events{/privacy}","received_events_url":"https://api.github.com/users/ctrueden/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/imagej/imagej/milestones/5","html_url":"https://github.com/imagej/imagej/milestones/2.x","labels_url":"https://api.github.com/repos/imagej/imagej/milestones/5/labels","id":1055282,"number":5,"title":"2.x","description":null,"creator":{"login":"ctrueden","id":556626,"avatar_url":"https://avatars.githubusercontent.com/u/556626?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrueden","html_url":"https://github.com/ctrueden","followers_url":"https://api.github.com/users/ctrueden/followers","following_url":"https://api.github.com/users/ctrueden/following{/other_user}","gists_url":"https://api.github.com/users/ctrueden/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrueden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrueden/subscriptions","organizations_url":"https://api.github.com/users/ctrueden/orgs","repos_url":"https://api.github.com/users/ctrueden/repos","events_url":"https://api.github.com/users/ctrueden/events{/privacy}","received_events_url":"https://api.github.com/users/ctrueden/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2015-04-06T22:39:03Z","updated_at":"2016-02-26T21:12:58Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-04-06T22:35:44Z","updated_at":"2016-02-29T16:36:06Z","closed_at":"2016-02-26T21:12:58Z","body":"Right now, there is no way to pass script parameter values via the command line; e.g.:\r\n```\r\nImageJ-linux64 --headless fiji-plugins/HelloWorld.clj lena.jpg\r\n```\r\nImageJ should definitely support this. The question is: how best to assign the parameter values to the inputs? We could use key/value pairs, or simply take the arguments in order of `@Parameter` declaration. This would be a great feature of ImageJ2 facilitated by the parameterized scripting framework, since AFAIK you cannot do this with ImageJ1's macro syntax, either.\r\n\r\nSee also [this thread on the ImageJ mailing list](http://imagej.1557.x6.nabble.com/Scripts-in-FIJI-with-command-line-arguments-tp5011265.html)."},"comment":{"url":"https://api.github.com/repos/imagej/imagej/issues/comments/190280058","html_url":"https://github.com/imagej/imagej/issues/121#issuecomment-190280058","issue_url":"https://api.github.com/repos/imagej/imagej/issues/121","id":190280058,"user":{"login":"ehrenfeu","id":697157,"avatar_url":"https://avatars.githubusercontent.com/u/697157?v=3","gravatar_id":"","url":"https://api.github.com/users/ehrenfeu","html_url":"https://github.com/ehrenfeu","followers_url":"https://api.github.com/users/ehrenfeu/followers","following_url":"https://api.github.com/users/ehrenfeu/following{/other_user}","gists_url":"https://api.github.com/users/ehrenfeu/gists{/gist_id}","starred_url":"https://api.github.com/users/ehrenfeu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehrenfeu/subscriptions","organizations_url":"https://api.github.com/users/ehrenfeu/orgs","repos_url":"https://api.github.com/users/ehrenfeu/repos","events_url":"https://api.github.com/users/ehrenfeu/events{/privacy}","received_events_url":"https://api.github.com/users/ehrenfeu/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T16:36:06Z","updated_at":"2016-02-29T16:36:06Z","body":"Actually, for Python scripts I did this already quite a while ago by introducing \"triple-dash\" arguments and parsing them via the standard [argparse](https://docs.python.org/2/library/argparse.html) module. See my OIB/OIF stitcher for an example (argparse code starts at [line 197](https://github.com/imcf/imcf-toolbox/blob/master/fiji/tools/FluoView_OIF_OIB_Stitcher.py#L197)):\r\n\r\nhttps://github.com/imcf/imcf-toolbox/blob/master/fiji/tools/FluoView_OIF_OIB_Stitcher.py"}}