Skip navigation
Currently Being Moderated

How to rename a file while importing to Adobe Premiere Pro?

Feb 26, 2013 3:43 AM

Tags: #adobe #premiere #cs #extenions #extension_builder #extension_development

I'm developing an extension for Adobe Premiere Pro using CS Extension Builder to import files from internet. I achieved that using the following code

var app:App = Premiere.app;
var pjct:Project=app.project;
var astPath:String = "path to file";
if(pjct!=null)
{
     var fileArray:Array=[];
     fileArray.push(astPath);
     pjct.importFiles(fileArray);
}

 

Now I have to rename the file before it is imported to Premiere. I don't want to use the file name as it is in the server. How can I do that?

 
Replies
  • Currently Being Moderated
    Feb 26, 2013 4:18 AM   in reply to NirmalRaghavan

    Use the AIR File class methods to rename the file.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 26, 2013 4:36 AM   in reply to NirmalRaghavan
    var astFile:File = new File("path to file");
    var newLocation:File = new File("path to new location");
    if(!astFile.exists){
         throw new Error("Uh... you do need a valid file for this...");
    }
    astFile.moveTo(newLocation,true);// this will overwrite the file if it already exists!
    

     

    You can then grab newLocation.url or newLocation.nativePath (assuming that's waht you need...)

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 26, 2013 8:13 AM   in reply to NirmalRaghavan

    I think importFiles takes an array of File objects (see: http://forums.adobe.com/message/4710331). I'm not entirely sure what you mean by "renaming the imported file but not the exact file" - do you mean you don't want to rename the file on disk, but change the name Premiere uses for the file? I'm not sure if that's possible. The scripting DOM for Premiere is quite limited, and I'm afraid that I'm not that familiar with it.

     

    Hope that helps,

     

    --Louis

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 26, 2013 8:51 AM   in reply to NirmalRaghavan

    I'm not familiar with the Premiere scriting DOM. Is it accessible in the ExtendScript Toolkit? That would be where you'd find the most complete documentation.

     

    I also do not know what you are trying to do...

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points