Hi, Tongjun --
Thanks for this good question.
We''re working on automation features like this, but we''re not there yet. Our best suggestion would be to locate a Python-based library and use that instead.
For background, there are two mechanisms for automating Cytoscape: cyCommands (for scripts) and cyREST (for application-based invocation). We intend to support JActiveModules and many other functions via either of these mechanisms, and we''re working to make this happen. Look for something like this in the next several months.
Thanks!