1 Reply Latest reply on Sep 26, 2010 11:25 PM by sunmoonstar.13

    Script step(s) to test for valid reference in a container field

    ralvy

      Title

      Script step(s) to test for valid reference in a container field

      Post

      Is there a way to have a script test a reference in a container field to see if that file exists?

        • 1. Re: Script step(s) to test for valid reference in a container field
          sunmoonstar.13

          Try this:

           

          Set Variable [ $_filepath ; GetValue ( GetAsText ( your_table::your_container_field ) ; 2 )
          Set Error capture [On]
          Insert File [ Reference ; your_table::your_container_field ; "$_filepath" ]
          If [ Get ( Last Error ) = 0 ]
               Show Custom Dialog [ "File" ; "File exists." ]
          End If

           

          The script attempts to re-insert the same file reference into the same container field. If successful, a dialog pops up saying that the file exists. If not, a standard Insert File dialog will pop up. 

           

          Nick