Hi. So, this has been covered probably dozens of times on the Jamf forums. Have you done any searches using a similar term to see what comes up? I'm willing to bet you will find a thread that will help you out.
I'm happy to post some code here if you really need it, but it feels redundant to do so since I know it's been covered a lot on here.
This is an older thread, but might still be helpful.
If the commands listed in there don't work, post back. There is a more updated and reliable method of running a command, launching an app or other things, as the current user from a Jamf run policy.
As an aside, I feel like Jamf really needs to think seriously about adding this basic capability in to their framework, a la this Feature Request. We've all been using workarounds for years now to get this to happen. It would be so helpful if Jamf included some easy checkbox way to say "do this policy or thing as the user logged in, not as root"
I've scoured the forums on Jamf Nation and not found anything relevant.
I've also tried every possible solution from the forums.
The previous "solutions" date back to 2012 or older, and don't seem to work in newer versions of macOS. Any other ideas? It seems at least the premise is still accurate: we want to script opening an app as the currently logged in user.