Call script from Windows command line

不羁岁月 提交于 2019-12-11 12:55:04

问题


Is it possible to call a script in Digital Micrograph from the Windows command line? I cannot seem to find information on command line options, if any are available, for DM.


回答1:


No, this is not possible for GMS version 2 or lower. There are no command-line parameters for script-launch in DigitalMicrograph.

However, if you want to run a script automatically on start-up of DM, you can do this by installing a script as plugin (.gtk file).




回答2:


From GMS 3.0.1 onward, there is an optional start-up parameter for the application.

You can type (in the command prompt):

DigitalMicrograph.exe /ef "test.s"

to launch the script test.s within the application.

Similar, you can type things like

DigitalMicrograph.exe /es "scriptcommand"

to directly execute the script-line scriptcommand within the application.

Unfortunately, earlier version of GMS do not have this option.

Note: When you call DigitalMicrograph.exe while the application is already running, it will not start the program again but instead activate the already running application. Therefore this can be used to launch a script in an already running application.



This also opens a nice way to run DM-scripts from a different editor like NotePad++.

In NotePad++ you can configure a "run" command. If you press F5 you specify a command to be called. So to have this run a DM script, use a line like the following:

"C:\Program Files\Gatan\DigitalMicrograph.exe" /ef "$(FULL_CURRENT_PATH)"

You can then execute a script writtin within NotePad++ simply by selecting this run.



来源:https://stackoverflow.com/questions/28495288/call-script-from-windows-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!