5 Replies Latest reply on May 12, 2017 10:16 AM by e.d.

    Creating a Sequence by Linking to Preset -- Filepath issue

    jportell25 Level 1

      I am trying to create a sequence from a variety of presets. These presets work well when I am directly linking to the .sqpreset in a drive on my computer, however I would like to package these links within the panel directory so they can work anywhere.

       

      When I run the following code it works great if running directly from Extendscript, but when I load it in a panel I have no luck.

       

                 var scriptLocation = File($.fileName).fsName

                 sliceOne = scriptLocation.lastIndexOf("/");

                 var filePlacement = scriptLocation.slice(0, sliceOne+1)

       

                   var preset1360 = filePlacement + "Presets/1360x768_30FPS.sqpreset";

                   var preset720 = filePlacement + "Presets/1280x720_30FPS.sqpreset";

                   var preset1080 = filePlacement + "Presets/1920x1080_30FPS.sqpreset";

       

      app.enableQE();

                

              if (seqPreset == "1080"){

                      desiredPreset = preset1080

                  }

              if (seqPreset == "720"){

                      desiredPreset = preset720

                  }

              if (seqPreset == "1360"){

                      desiredPreset = preset1360

                  }

                  

        if (seqPreset == "1080" || seqPreset == "720" || seqPreset == "1360" ) {

                      qe.project.newSequence(seqName, desiredPreset);

        }else{

                         alert("Please try again." + "\r" + "\r" + "Enter a valid resolution")

                  }

             

              }

       

      Any help would be great. Making sequences is essential but if I can't package the preset, that'd be a shame.