in commands/FBPrintCommands.py [0:0]
def run(self, arguments, options):
control = fb.evaluateInputExpression(arguments[0])
targets = fb.evaluateObjectExpression(
"[[{control} allTargets] allObjects]".format(control=control)
)
targetCount = fb.evaluateIntegerExpression(
"[{targets} count]".format(targets=targets)
)
for index in range(0, targetCount):
target = fb.evaluateObjectExpression(
"[{targets} objectAtIndex:{index}]".format(targets=targets, index=index)
)
actions = fb.evaluateObjectExpression(
"[{control} actionsForTarget:{target} forControlEvent:0]".format(
control=control, target=target
)
)
targetDescription = fb.evaluateExpressionValue(
"(id){target}".format(target=target)
).GetObjectDescription()
actionsDescription = fb.evaluateExpressionValue(
'(id)[{actions} componentsJoinedByString:@", "]'.format(actions=actions)
).GetObjectDescription()
print(
"{target}: {actions}".format(
target=targetDescription, actions=actionsDescription
)
)