Using action selector output in script

Found this work around here.
I works with some limitations, but it works