Back button navigation

Has anyone ever made a reverse navigationlike this before? I would think that using tags to keep track of the recent windows would slow down the project?

almost there…
I append a string tag and it has this in it:

[u’Setup/Group Setup’, u"[u’Setup/Divert Setup’, u’’]"]

How can I select the second one here?
my client tag change script is this:

import system
Recent = system.tag.read("[System]Client/User/CurrentWindow").value
old = system.tag.read(“LastWindow”).value
list = [Recent]
list.append(old)
system.tag.writeToTag(“LastWindow”, list)
I’m starting to think I should be writing to a database all these strings of past windows…

Yes, you should either be writing these to the database or to a client dataset tag. Let’s say you go down the client dataset tag route. You can create a new client tag that is a dataset called “Recent Windows”. You script will look something like this:import system recentWindows = system.tag.read("[Client]Recent Windows").value old = system.tag.read("LastWindow").value system.tag.write("[Client]Recent Windows", system.dataset.addRow(recentWindows, [old])That is assuming the dataset has only one column that is the window path. You can easily get information out of the dataset:recentWindows = system.tag.read("[Client]Recent Windows").value firstWindow = recentWindows.getValueAt(0, 0) secondWindow = recentWindows.getValueAt(1, 0)

I am having some difficulty with the code I wrote before your post.
I chose to try string tags
… I couldn’t seem to get it to work with client tags though.
I like the idea of using dataset tags better.
Somehow I need to implement what you have into what I have here

[code]back button
system.tag.writeToTag(“ChangeCount”, 0)
last = system.tag.read(“LastWindow”).value
if len(last) > 2:
place1 = last.find(’ ‘)
last = last[place1 + 2:]
place2 = last.find(’ ') # [0,5,10,15]
Window = last[0:place2]
if len(Window) > 0:
system.nav.swapTo(Window)
system.nav.centerWindow(Window)
system.tag.writeToTag(“LastWindow”, str(last))
system.tag.writeToTag(“ChangeCount”, 1)

client tag change script for current window
import system
Recent = newValue.value
gold = system.tag.read(“ChangeCount”).value
if gold == 1:
list = []
list.append(Recent)
#if system.tag.exists(‘LastWindow’):
old = system.tag.read(“LastWindow”).value
if len(old) > 200:
system.tag.writeToTag(“LastWindow”, ‘’)
else:
list.append(old)
sum = ‘’
for str in list:
sum = sum + str + ’ ’
cache = sum
system.tag.writeToTag(“LastWindow”, cache)[/code]

and this doesnt compile:

import system recentWindows = system.tag.read("[Client]Recent Windows").value old = system.tag.read("[System]Client/User/CurrentWindow").value system.tag.write("[Client]Recent Windows", system.dataset.addRow(recentWindows, [old])

Rookie mistake, I forgot the last paran:import system recentWindows = system.tag.read("[Client]Recent Windows").value old = system.tag.read("[System]Client/User/CurrentWindow").value system.tag.write("[Client]Recent Windows", system.dataset.addRow(recentWindows, [old]))

So what’s wrong with using system.nav.goBack()?

!!!
thanks.

I should learn to use ctl+ spacebar more often…

Or read the user manual :slight_smile: Appendix C lists all the scripting functions.