Time Based Screen Rotation Help

First post here so bear with me. I have found a few topics on this previously and I have used the sample code provided, but I am still having problems with this code not working. I get no errors when I put in the code but it seems like it just does not run the script. The tag value never changes either, it is always a 0. Any help with this would save the rest of my hair from being pulled out of my head. Thanks in advance....V8.1.32

The function is system.nav.swapTo, not system.nav.SwapTo - you're probably getting an error on that line in your local client logs, and the exception is stopping execution before it gets to line 8.

Thanks for the correction there. I have made the change and still not working. Where can I find the error log that would display this?

It'll be on your running client in the diagnostics. By default, there's an item in the Help menu, but if you've disabled the menu bar in your client you can access it with a shortcut Ctrl + Shift + F7:

You've put [client] into all of your window names. That certainly won't work.

Sorry I am new to the game here. Do I remove [client] from everything in the code or just the Windows lines?

Something like this. Tip: post code as code, not just a screenshot

tagpath = "[client]Rotation"
windows = ["Windows/ExtrusionNew", "Windows/Ovens"]

x = system.tag.read(tagpath).value % len(windows)

system.nav.swapTo(windows[x])

system.tag.write(tagpath, x + 1)

Tip Noted. Thank you

Now in the log viewer I can see this error.

Try a capital C in [Client].

With this code

tagpath = "[Client]Rotation"
windows = ["Windows/ExtrusionNew", "Windows/Ovens", "Windows/Packing"]

x = system.tag.read(tagpath).value % len(windows)

system.nav.swapTo(windows)

system.tag.write(tagpath, x + 1)

Now I get this error

Show your Designer tree of window names.

(Have you gone through Inductive University--the free online training? You are experiencing many problems that suggest you haven't.)

I have only done a few. Im just starting with scripting.

Remove Windows/ from all of your window names. That Windows in the tree is the root of all window paths.

1 Like

That was it! Thanks for the help and patience.

You can also right click any window or template and copy its path; this is more useful when you end up with actual folders in a more complicated project.

2 Likes

Also, since this is 8.1.32, you shouldn't use that deprecated function anymore, you should be using system.tag.readBlocking, however there's an impotent difference, the new function returns a list not a single BasicQualifiedValue,regardless if you pass in a string or a list of strings. So you need to use system.tag.readBlocking('...')[0].valueto read the value

1 Like

I'm intrigued! :thinking:

1 Like

My dad tells a joke about a man who misheard his doctor telling him he was impotent, so he went home in a suit and tie back to his wife because the doc said he was "important" :sweat_smile:

Not sure I can tie a joke to this one though!

1 Like

3 Likes