7 Replies Latest reply on May 24, 2016 5:27 PM by Charlesdh

    Image Names

    Charlesdh

      HI,

       

      A new problem for me. The Image in my file are named with ".jpg" or ".png". (Example "19DH1234 567.jpg")

      Is there a way to be able to get the Image with out using the ".jpg" or ".png" in my script?

      If some one could point me in the right direction. I think a or error may work.

      Mean while I look at the "On Error" aspect.

      Any suggestion would be appreciated.

       

      Thanks

      Charles

        • 1. Re: Image Names
          user19752

          Where do you use the filename? You can specify any number of paths for example in "Insert Picture" as

          image:your/file/path1.jpg

          image:your/file/path1.png

          then first file found is used.

          • 2. Re: Image Names
            Charlesdh

            Hi,

            The Image file is in the same path as my program.

            All of the Images have either ".jpg" or ".png".( Image file)

            The  Product::Pimage text is "19DHZ1234 563" with out the ".jpg" or ".png".

            I can use calculation to specify either ".jpg" or ".png". But would prefer not too.

             

            Thanks

            Charles

            Set Variable [$path ; value: 'imagewin://Mac/Home/Documents/Images/" & Product::PImage]

             

             

             

            • 3. Re: Image Names
              Charlesdh

              Hi,

               

              I'm still looking for help.

              This is the script that I'm working on in order to change the Image Name from ".jpg" to ".png" and vise versa.

              Any help would br appreciated.

              user19572. Thanks for you suggestion.

              Charles

              • 4. Re: Image Names
                user19752

                I can't get what do you want saying "vise versa".

                You don't set any extension in $path, so the "Insert Picture" get always error.

                What do you want to showing dialog when the file is not found?

                Do you want to make all images as .jpg? (aka, if it is .jpg stay it .jpg, if .png convert it to .jpg)

                 

                You can insert with 2 paths like

                Set Variable [ $path; Value: "imagewin://Mac/Home/Documents/Images/" & Products::PImage & ".jpg" & ¶ & "imagewin://Mac/Home/Documents/Images/" & Products::PImage & ".png" ]

                if there is .jpg or .png

                1 of 1 people found this helpful
                • 5. Re: Image Names
                  Charlesdh

                  user19752,

                   

                  Thanks for your response.

                  I used the dialog for debugging.(I do not have the Advance version of FM)

                  After reading my last post I can see that it was very missing leading.

                  My thought was to use a "Wild" in a script( Calculation?). I have a calculation for the "PImage" that adds the "FileType" to the image name. But, I was looking for a way to use a calculation with a wild card. This way no matter what the image "Type" is the found image would be used. I can use a Excel code that would change all of the Image to the desired "Type". But, I would need to rerun the code if new images are added to the image file.

                  I hope this is a better clarification of what I would like to do.

                   

                  Thanks

                  Charles

                  • 6. Re: Image Names
                    user19752

                    I see.

                     

                    There is no wild card syntax for file path in FM. You need to use parsed result of wild card, in this case each .jpg and .png line in file path, if there can be more Type, use more lines.

                     

                    FM support "Import Folder" for inserting images to records at once, near wild card but you can specify only folder, so file name with wild card is always *.*

                    • 7. Re: Image Names
                      Charlesdh

                      user19752,

                       

                      Thanks for the reply.

                      I'm learning quite a bit  from this forum.

                       

                       

                      Charles