Get username inside Gateway Scheduled Script

Is it possible to retrieve the username of who is logged in a Gateway scheduled script ?

Nobody is logged into a gateway scheduled script.

1 Like

Ok that makes sense, let's say I run a project library script from the gateway scheduled script, can I retrieve that info from the project library script?

There is no user associated with a gateway scheduled script, regardless of whether you call into a project script or not.

Is this what you're asking, or are you asking if there's away to e.g. get a list of all the sessions that currently exist (which have a user associated with them)?

I guess I was asking both, now that I know that, is there a way to get a list of all the sessions, and know which session the script is being run off to get the associated username ?

you don't seem to understand, the script is not being run by any session. It's part of the project, and runs on the gateway, and would continue to be run and scheduled even if no users were logged in.

1 Like

You can get session info via:
https://docs.inductiveautomation.com/display/DOC81/system.util.getSessionInfo
https://docs.inductiveautomation.com/display/DOC81/system.perspective.getSessionInfo

but again, there is no session associated with a gateway scheduled script.

1 Like

perfect - thank you