RunScript runScript = new RunScript(getWindow());
String methodCallText = "person.setName(\"Bob\")";
IType personType = getJavaProject().findType("com.example.Person");
String personSource = personType.getCompilationUnit().getSource();
int offsetOfCall = personSource.indexOf(methodCallText);
runScript.withContents(
"var person = Find.typeByName('Person');\n" +
"var ast = AST.parseCompilationUnit(person.getCompilationUnit());\n" +
"var node = AST.findCoveredNode(ast, " + offsetOfCall + ", " + methodCallText.length() + ");\n"
, null, "inline script");