you can add the Go To Object  to your script..
First you would need to name both tabs in the inspector then use this name in the above and that should be it.. under position ... Name..
You'll also need to capture the object name of the currently visible tab panel before your script changes layouts. You can use the OnPanelSwitch trigger and Get ( TriggerTargetPanel ) to capture the name of the target panel each time the user selects a tab panel and put it in a global variable so that your script can use that with JP's suggested go to object script step.
Note: In FileMaker 12, the trigger and get function parameter names are similar but slightly different.
(oops, posted this at same time as Phil, so this was a reply to JP). okay Phil will take a look.
i'm sorry...i am aware of and use Go to Object, but I am not sure what you are suggesting to accomplish my goal of returning a user to their original tab when a layout changes. I understand Go to Object as far as directing someone to go to a specific tab, for example, go to Tab A or go to Tab B...and I have used it in scripts. but I do not know how to integrate this into this script.
can you be more specific? Thank you.
Back again on this one...doing something wrong here. I have two tabs and want to return to previous tab on a layout switch.
First Script: Get Panel Switch run as Script Trigger on OnPanelSwitch
Set Variable [$$TabName; Value: Get (TriggerTargetPanel)]
Second Script: Run as Script Trigger when layout entered.
(I'll skip the non-pertaining parts, but include entire script as image below)...
Go to Object [Object Name: $$TabName]
Help? (and much thanks!)
Thank you for your posts.
If you want to call the original tab panel, then use Get ( TriggerCurrentPanel ) first to capture the original tab panel. The Get ( TriggerTargetPanel ) is used to know where you are headed; not where you are coming from.
thanks for your reply TSGal. I tried Get (TriggerCurrentPanel) as well and no go. In running the script debugger it seems that the variable is being successfully captured. $$TabName 1 Service Call or $$TabName 2 Photos: Commission.
So I guess my problem is in the second script? If I just change the Object Name to one of the tabs, it goes to those tabs, so I am at a loss. All I am trying to do here is return to the active tab when an iPad is rotated to portrait or landscape with Go.
and I wavered on the whole TriggerCurrentPanel vs TriggerTargetPanel for a while, and it seemed that:
...since I am triggering the script before going to the new tab, then the target tab is what I want to store in the variable.I'm running the script OnPanelSwitch and the script is run before the panel actually switches.
so the irony...i got it to work just fine. thanks for all of the help. here is the irony part:
what i got is restore tabs working when switching between layouts when (now that i can see it functioning) what i really need is to switch to same tab upon rotation.
ipad portrait layout>>> tab a and tab b
ipad landscape layout>>>tab a and tab b
when rotating from portrait to landscape layouts and back again, if tab b is selected on ipad portrait then go to tab b on ipad landscape.
need to ponder this but any help appreciated. b.
Get ( TriggerTargetPanel ) returns two values; the number of the tab panel, and the name of the tab panel. Since you want to go to the name of the tab panel, change your initial "Get Panel Switch" script to:
Set Variable [ $$TabName ; Value: GetValue ( Get ( TriggerTargetPanel ) ; 2 ) ]
Leave the other scripts alone.
Make sure on both the iPad Portrait Layout and the iPad Landscape Layout that the tab names are named identically.
In recent years, you and your colleagues have made me look much smarter than I am. Your solution worked and taught me something as well. Thank you so much - it worked perfectly.