Is it possible to have a 'callback' that simply redirects the client to a different menu?

I’ve created a plugin to run arbitrary scripts within the Plex server’s filesystem. These scripts produce output on stdout and stderr. To display the output I’m splitting them by line, and creating a DirectoryObject with the line as the title.

The problem I’ve got is those DirectoryObject’s (as far as I can tell) have to do something when the user selects them. Ideally in this case I’d like the user to get redirected back to the list of scripts they can run. The most important thing for me though, is that a Plex client doesn’t treat selecting it as going further down the ‘tree’ of menu items, as if the user chooses to go back the script will get ran again, which the user may not want.

So, is it possible to have a menu item that when selected redirects to an earlier menu item, or perhaps does the equivalent of selecting the back arrow in the web client (going up a directory)?

Yes there is a function you may try: Redirect(url). But it is still likely to cause that ‘going down the tree’ issue, that depends on the Plex client application you’re using. ObjectContainer has attributes like no_history or replace_parent that supposedly are there to deal with such tree issues, but at least for some Plex clients they do not work…

There is a thread where a somewhat similar issue is discussed, but I think that there was no ‘real’ solution and the OP has resorted to a workaround that may not be applicable in your case: https://forums.plex.tv/discussion/comment/1588245

THanks for the quick reply. I’ve had a play and it looks like I can’t reliably get what I’m after. What I’m doing now is just displaying a message warning users not to use the back button in either the browser or plex. I’ll update this if I figure anything else out though.