RobotStudio event

How would I get the current path and line number of a motion task from a separate semi-static task?

Options
I am trying to log motion supervision errors and what path and line they occurred on.