With the new Inspect Automate option, you can create Trace Fields in Inspect, which are then passed into the routine as variables.
You would need...