Any idea how to do this via scripting, or if it's even possible?
Does it record Action Manager code with ScriptingListener.plugin?
Yes it does thanks. In the end I decided to just use an Action to automate what I needed - much easier and simpler this way.
Retrieving data ...