Skip to main content
Participant
September 13, 2023
Question

CEP: set/read scratch paths on/from project

  • September 13, 2023
  • 2 replies
  • 471 views

Hi there,

 

we would like to write and read the scratch paths to/from a Premiere Pro project.

 

With the following code, we set the value for the auto-save folder in the project:

app.project.setScratchDiskPath('c:\\default', 'BE::kPrefsScratchDisksFirstAutoSaveFolder');

 

How can we read the value from the project (not from the app!)?

 

We know, there is a 'app.properties.getProperty('BE.Prefs.ScratchDisks.FirstAutoSaveFolder');' that returns the last set value globally for the whole app, but this is not the actual scratch disk value of the current project.

 

We want to read out the specific scratch disk values for a specific project.

How can we do that?

 

Thank you,

Steffen

 

 

This topic has been closed for replies.

2 replies

Participant
September 22, 2023

Thanks for your reply!

I wrote a small script to show, what we're trying to describe:

 

function printAutoSavePaths() {
$.writeln("printAutoSavePaths()");
var projects = app.projects;
var foundProjects = [];
for (var i=0; i < projects.numProjects; i++) {
var project = projects[i];
$.writeln("[Project:" + project.name + "]" + "[AutoSave:" + app.properties.getProperty('BE.Prefs.ScratchDisks.FirstAutoSaveFolder') + "]");
}
$.writeln("");
return foundProjects;
}

var documentPath1 = 'C:\\temp\\1.prproj'
app.openDocument(documentPath1, true, true, true, false);
app.project.setScratchDiskPath('c:\\default\\1', 'BE::kPrefsScratchDisksFirstAutoSaveFolder');
app.project.save();
printAutoSavePaths();

var documentPath2 = 'C:\\temp\\2.prproj'
app.openDocument(documentPath2, true, true, true, false);
app.project.setScratchDiskPath('c:\\default\\2', 'BE::kPrefsScratchDisksFirstAutoSaveFolder');
app.project.save();
printAutoSavePaths();



Could you run the script above and check the Auto-Save Scratch-Disk settings under "File -> Project Settings... -> Scratch Disks..."?
(Tested with PPRO 23.4.0. Precondition: save file 1.prproj and 2.prproj to C:\temp)


The output should be somethin like this:

printAutoSavePaths()
[Project:1.prproj][AutoSave:c:\default\1]

printAutoSavePaths()
[Project:2.prproj][AutoSave:c:\default\2]
[Project:1.prproj][AutoSave:c:\default\2]

Ergebnis: undefined


So, how can we get the Scratch Disk Information from project 1.prproj then?

Justin Taylor-Hyper Brew
Community Expert
Community Expert
September 14, 2023

Quick test looks like the provided example does return the project-level auto-save folder.

app.properties.getProperty('BE.Prefs.ScratchDisks.FirstAutoSaveFolder');

 

Can you provide some screenshots if that's not what you're experiencing?