3 Replies Latest reply on Jun 26, 2012 11:47 PM by Sorbsbuster

    reference a layout name in a script

    robdownunder

      Title

      reference a layout name in a script

      Post

      Hi,

      I'd like to do a check such as

      If [ $layout_name = "My Layout" ] 

       

      How can I reference "My Layout" so that the script will be robust against changes to the layout's name ?

      I've Googled the topic to death but can't find an answer.

      Thanks,

      rob

        • 1. Re: reference a layout name in a script
          philmodjunk

          Be nice if you could, but you can't.

          Best I can suggest is:

          Set up a table of layout names. You can use a script that loops through all your layouts to update this table with current layout names any time you modify a layout's name. Your script would then use a relationship to match the current layout name to a specific record in this table.

          I find that I rarely need to modify a layout's name, but then I also don't expose the status area in most of my solutions and thus the layout drop down is not made available for use by the general user. I find that a few buttons and other controls in the top left corner of the layout can serve the purpose of the status area while using a much smaller fraction of the screen to do so.

          • 2. Re: reference a layout name in a script
            robdownunder

            Thanks Phil,

            Yes it would be nice to have this feature. Will have to submit it as a feature request.

            I found a custom function that someone wrote to get the internal Layout ID number for any given layout, and I've hardcoded those IDs into a script. This should protect me from layout name changes, which is a step in the right directon.

            My appiication for this is to have custom 'Page Setup' settings for each layout attached to the print button. Each layout can now have a unique print setup.

            It's working nicely now.

            • 3. Re: reference a layout name in a script
              Sorbsbuster

              You could have a few scripts, A4Port', A4Land', etc and nominate them as a script parameter on the print button, then make the final Print script call the page set up determined by the script parameter.