Insert Window name in the script editor

I have been desiging a few applications as a starting point for our site and find myself at least initially wrangling with alot of complex page navigation. This is made worse by the fast that almost half of my troubleshooting has been typo’s with the window names!

This is obviously my own stupid fault but if there was a lookup - similar to the tag or property lookup buttons this would not have been so much of an issue. I am not sure if you could combine this with the property/reference lookup page by showing all windows (maybe with the noncurrent windows having the attributes greyed out?) and allowing selection of the window name for insert?

Possibly it would be easier on its own seperate button but I am not so bothered how its done.

I had the same trouble when first configuring a tab strip where I mistyped the window names a few times and when you clicked it - nothing happened, no error or warning or anything. It might be useful to put the same button inside the Tab Strip Customizer.

Or perhaps I am the only nuffy that mistypes these things…

Daniel - you don’t always have to type in window names. Using the “Navigation” tab to select your action will allow you to choose the “swap” radio button and select a window from the drop down list. This video is a bit dated (2008), but it illustrates the concepts of how navigation works. The part between about 6 and 8 minutes in is the most relevant for what you’re asking.

As far as the tab strip, that works a little differently. When set on the default “Swap to window” Navigation mode, you need to do the following: In the Tab Data dataset, the NAME field needs to match your window names exactly (it is case sensitive). You can show whatever you want in the corresponding DISPLAY_NAME. The best way to edit this is via the Tab Strip Customizer, by right clicking the tab strip -> customizers -> tab strip customizer (or Cntl+U).

Yeah, I figured it was case sensitive after I screwed it up a couple of times.

I was using the easy customiser but because I have a top navigation pane that selects a sub left navigation pane that in turn navigates the pages I turned to scripting instead.

I still think that because its so fussy and doesnt ‘validate’ the window names in situe that a lookup would be neat - but thats probably just because I am a poor typist who is most used to vba scripting that checks everything for me as I do it :wink:

I think I just need to be a little more careful and what they do in the tutorial videos which is copy and paste EVERYTHING to make sure that spelling mistakes dont crop in. I have even seen them do this from the help files scripting appendix for functions which I have now started to do as well. It seems to be helping a little.

Here is what I am trying to do, this is the script that I have in my top navigation bar which is supposed to select a side/sub navigation bar and open the first window from that pane. I am not sure what I am doing wrong yet but I feel like I am close.

if event.propertyName == “selectedTab”:
##Create as many groups of the following three lines as you have tabs in your main navigation bar
##tabName.append(“Name of Tab Here”)
##tabNavPath.append(“Name and path of sub nav page here”)
##tabFirstPagePath.append(“Name and path of first page of the sub nav here”)

tabName = []
tabFirstPagePath = []
tabNavPath = []

tabNavPath.append("000 Nav/010 Main Nav")
tabFirstPagePath.append("010 Main/011 Main")

tabName.append("Billet Prep")
tabNavPath.append("000 Nav/020 Billet Prep Nav")
tabFirstPagePath.append("020 Billet Prep/021 Billet Prep")

tabName.append("Die Oven")
tabNavPath.append("000 Nav/030 Die Oven Nav")
tabFirstPagePath.append("030 Die Oven/031 Die Oven")

tabNavPath.append("000 Nav/040 Press Nav")
tabFirstPagePath.append("040 Press/041 Press")

tabNavPath.append("000 Nav/050 Quench Nav")
tabFirstPagePath.append("050 Quench/051 Quench")

tabNavPath.append("000 Nav/060 Pullers Nav")
tabFirstPagePath.append("060 Pullers/061 Pullers")

tabNavPath.append("000 Nav/070 Stretcher Nav")
tabFirstPagePath.append("070 Stretcher/071 Stretcher")

tabName.append("Finish Saw")
tabNavPath.append("000 Nav/080 Finish Saw Nav")
tabFirstPagePath.append("080 Finish Saw/081 Finish Saw")

tabNavPath.append("000 Nav/090 Stacker Nav")
tabFirstPagePath.append("090 Stacker/091 Stacker")

tabName.append("Conveyor Network")
tabNavPath.append("000 Nav/100 Conveyor Network Nav")
tabFirstPagePath.append("100 Conveyor Network/101 Conveyor Network")

tabName.append("Ageing Oven")
tabNavPath.append("000 Nav/110 Ageing Oven Nav")
tabFirstPagePath.append("110 CAgeing Oven/111 Ageing Oven")

##set default windows if names do not match 
oldNavigationWin = tabNavPath[1]
newNavigationWin = tabNavPath[0]
newMainWin = tabFirstPagePath[0]

##find the window paths for old and new navigation panes to swap
##find the window path for the new main window
for tabNo in range(len(tabName)):
	if event.oldValue == tabName[tabNo]:
		oldNavigationWin = tabNavPath[tabNo]
	if event.newValue == tabName[tabNo]:
		newNavigationWin = tabNavPath[tabNo]
		newMainWin = tabFirstPagePath[tabNo]

##swap panes based on selected tab
system.nav.swapWindow(oldNavigationWin, newNavigationWin)

perhaps a better way would be to straight out ask - [color=#0000FF]how do you guys handle multiple navigation panes? [/color](master pane at the top, sub pane at to the left)

Any example code someone could provide I could look at to see where I am going wrong?

What i guess is complicating my script is that when I choose a different sub naviation pane I also want to switch to the first main window of that sub catogory - I am guessing this is where my problem lies.

I have tried disabling this part and am just not having much luck with this at the moment though