# New Window sizing and options, Card from a card?

**URL:** <https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064>\
**Category:** Questions\
**Tags:** scripting, windows\
**Created:** [April 28, 2021, 11:57am UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064 "2021-04-28T11:57:55Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpking](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/cpking/32/1179_2.png) [@cpking](https://the.fmsoup.org/u/cpking)\
**Post date:** [April 28, 2021, 11:57am UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/1 "2021-04-28T11:57:55Z")

</div>

As I continue tweaking my solution, I'm encountering little things I need to clean up.

I have a layout of a song list. The clicking on Song Title invokes a script that opens the related record from Songbook in a card using the Songbook layout. That works great!

The Songbook layout has a portal of musicians related to that song, which also works fine.  
The catch comes when on that portal, I want to add a musician (highlighted + button).

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/1/1cc0ff7e4c56c7aed21f1e65157cae4817d648df.png)

When I open the Songbook layout directly this works fine. It's when the Songbook layout is displayed in a card and I need to open an additional card.

The + button on the Songbook layout invokes a script which opens a card.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/2/2e59190ee5f4c755ac573ba28c2e5a05aafc9e81.png)

However, when this is used from the previously mentioned layout via the script, another iteration of the Songbook layout opens in the same window (card).

I've tried using Dialog, Floating Document, etc., but those all show scroll bars and the toolbar which is not clean and which makes sizing the window cumbersome. I've also tried using a calculation for the height/width of the window based on an object which is the size of the entire layout.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/d/dd6e17de7f2cda2f3d49f4a438ce9b9584757592.png)

Failing being able to open a card from a card, can someone recommend a way to accomplish this?

Thanks!

Clayton

---

<div class="post-metadata">

**Author:** ![Torsten](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/torsten/32/1574_2.png) [@Torsten](https://the.fmsoup.org/u/Torsten)\
**Post date:** [April 28, 2021, 12:00pm UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/2 "2021-04-28T12:00:19Z")

</div>

Please post the script that calls the card window.

---

<div class="post-metadata">

**Author:** ![cpking](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/cpking/32/1179_2.png) [@cpking](https://the.fmsoup.org/u/cpking)\
**Post date:** [April 28, 2021, 12:23pm UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/3 "2021-04-28T12:23:29Z")

</div>

Sorry about that - I mean to include the script in my OP.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/0/081803b31f85094451789ddbc3ab2ee0822528c1.png)

---

<div class="post-metadata">

**Author:** ![planteg](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/planteg/32/627_2.png) [@planteg](https://the.fmsoup.org/u/planteg)\
**Post date:** [April 28, 2021, 1:01pm UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/4 "2021-04-28T13:01:06Z")

</div>

This script created a new Window whose style is Dialog, but you talked about creating a card from a card.

Can you show the script invoking the second card please ? An better all the scripts starting the one that creates the first card. And please provide a screen shot regarding

> However, when this is used from the previously mentioned layout via the script, another iteration of the Songbook layout opens in the same window (card).

Thanks

---

<div class="post-metadata">

**Author:** ![cpking](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/cpking/32/1179_2.png) [@cpking](https://the.fmsoup.org/u/cpking)\
**Post date:** [April 28, 2021, 7:54pm UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/5 "2021-04-28T19:54:21Z")

</div>

As I mentioned earlier, the script from the original layout (which itself is in a card) opens the same layout in a new card. So the script was changed to open a dialog which I'm trying to edit.

This script is invoked from the songlist by clicking the song title; it brings up the Songbook layout.  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/1/13a38e4c6ec8cb9c4bb8682b2a184f4aff92e5b9.png)

On the Songbook layout (in the card) this script currently creates a new Songbook records in a card layout, rather than opening the Add a Musician card (e.g., goal is to open a card from a card).

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/a/a4f3c7fdabe9d8b1f3fa1774eb62252aebb732ef.png)  
Some logic needs to be wrapped around it to avoid creating new blank records.

---

<div class="post-metadata">

**Author:** ![planteg](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/planteg/32/627_2.png) [@planteg](https://the.fmsoup.org/u/planteg)\
**Post date:** [April 28, 2021, 9:34pm UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/6 "2021-04-28T21:34:01Z")

</div>

You need to do some debugging. In your script capture errors that may happen and display a custom dialog with the error number.

One other way is to start the debugger and check the box to stop on error.

You will then get clues.

---

<div class="post-metadata">

**Author:** ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)\
**Post date:** [April 29, 2021, 12:58am UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/7 "2021-04-29T00:58:29Z")

</div>

You can't create a card window from a card window. A card window always belongs to a parent window. Only one card window can exist per parent window.

---

<div class="post-metadata">

**Author:** ![cpking](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/cpking/32/1179_2.png) [@cpking](https://the.fmsoup.org/u/cpking)\
**Post date:** [April 29, 2021, 1:15am UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/8 "2021-04-29T01:15:47Z")

</div>

I thought as much from my test. Seems the best solution is a card and then a dialog from the card. Sizing and window attributes on the card are a problem inasmuch as I don’t want any toolbars on the dialog.

---

<div class="post-metadata">

**Author:** ![JamesG](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@JamesG](https://the.fmsoup.org/u/JamesG)\
**Post date:** [April 29, 2021, 7:42am UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/9 "2021-04-29T07:42:53Z")

</div>

At the beginning of a lot of my OpenNewWindow as Card type scripts, I use the Get(WindowStyle) function to determine if the Context is already a Card Window - if it is, the script will navigate to the required Card layout, rather than try and open a new Card... might be of help?...

---

<div class="post-metadata">

**Author:** ![cpking](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/cpking/32/1179_2.png) [@cpking](https://the.fmsoup.org/u/cpking)\
**Post date:** [April 29, 2021, 9:27am UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/10 "2021-04-29T09:27:48Z")

</div>

@JamesG , just to clarify. If the Context is already a Card Window, what are the mechanics of getting to the (new) card layout? I've had some success with just changing the 2nd card to a dialog instead of a card which opens the layout with the same dimensions the card would have used - I just don't like the toolbars and such that come along with it. In terms of navigating to to the Card layout, it seems I'm stuck on the first card until I close it.

---

<div class="post-metadata">

**Author:** ![JamesG](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@JamesG](https://the.fmsoup.org/u/JamesG)\
**Post date:** [April 29, 2021, 9:42am UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/11 "2021-04-29T09:42:24Z")

</div>

You can't change the WindowType from 'Card' to 'Dialog' - I'm just suggesting switching layouts, rather than opening a new window, when the script is run whilst a Card Window is the active context. Here's an example of the script steps:

 ![Screenshot 2021-04-29 at 10.41.47](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/d/db25119bdeaa2d7faa94a15d96e41c29b68e53e8.png)

---

<div class="post-metadata">

**Author:** ![cpking](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/cpking/32/1179_2.png) [@cpking](https://the.fmsoup.org/u/cpking)\
**Post date:** [April 29, 2021, 10:22am UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/12 "2021-04-29T10:22:30Z")

</div>

Cool! Thanks!

---

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [April 29, 2021, 11:22pm UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/13 "2021-04-29T23:22:36Z")

</div>

This test and the follow-on behaviour is important when you have multi-layout workflows in a card window.

---

<div class="post-metadata">

**Author:** ![mrocharde](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mrocharde](https://the.fmsoup.org/u/mrocharde)\
**Post date:** [May 5, 2021, 6:38am UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/14 "2021-05-05T06:38:06Z")

</div>

Matt Petrowsky, a long time ago, came up with a technique to open a second card window. If I remember it correctly, he opened a new window off screen and then a card window from that psitioned wher it could be seen, thus creating two or more card windows. The caveat was to name the off-screen window and have a button on the card window that would close it and the window it was attached to. I believe he gave an example of having multiple card windows open at the same time.

---

<div class="post-metadata">

**Author:** ![mrocharde](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mrocharde](https://the.fmsoup.org/u/mrocharde)\
**Post date:** [May 5, 2021, 6:44am UTC](https://the.fmsoup.org/t/new-window-sizing-and-options-card-from-a-card/2064/15 "2021-05-05T06:44:38Z")

</div>

One trick that I use quite often is to have multiple layouts exactly the same sizze. I can thus open one up as a card window and then have buttons on it to go to another identially sized layout with buttons (positioned in exactly the same place) to go to the previou layout or to another one. That way the user sees only one card window but can go right back to where they were and there is no jump. (To facilitate this process, I created a default screen with all elements positioned where I want them,..Then all I have to do is duplicate that layout rename it and set the context.
