1 Reply Latest reply on Mar 26, 2015 6:17 AM by philmodjunk

    Container Export Script Alteration



      Container Export Script Alteration


      Hi All,

      I have for example 20 layouts each with 10 container fields(all containing images)

      To open each container by a button i have a script setup (that i must admit to copying and mostly understand but not fully). 

      I understand that it exports the picture to a temporary path, then opens it, then on closing it is deleted.


      What i am trying to achieve is where the LayoutName is changed for 200+ scripts have the script determine the name from the layout it is on. (The 10 field names are identical so would not need changing). This way the 10 scripts i make would work for the 20 layouts. 


      Is this possible, if so how? or any advice on a easier way to open the container fields would be very appreciated.


      Allow User Abort [ Off ]
      Set Error Capture [ On ]
      Set Variable [ $path; Value:Get ( TemporaryPath ) ]
      Set Variable [ $filename; Value:Middle ( GetAsText(Layout Name::Field) ; Position ( GetAsText(Layout Name::Field) ; "/" ; 1 ; PatternCount ( GetAsText(Layout Name::Field) ; "/" ) ) + 1 ; 1000 ) ]
      Set Variable [ $final_path; Value:$path & $filename ]
      Export Field Contents [ Layout Name::Field; “$final_path”; Automatically open ] 


        • 1. Re: Container Export Script Alteration

          First fields are not defined in layouts, they are defined tables. Layout names and table occurrence names often match, but they can often be different also. having 20 different tables, each with 10 container fields sounds like a database design that needs improvement.

          While some script steps have an indirect reference version where you can calculate the name of the field, Export field contents is not one of them. You can, however, use go to field or go to object to put the focus in a particular container field and then use Export Field contents without specifying any specific field and then this step exports the contents of the field with the current focus.

          But I think you need to re-evaluate the underlying design of your database.