• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CEP: set/read scratch paths on/from project

New Here ,
Sep 13, 2023 Sep 13, 2023

Copy link to clipboard

Copied

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

 

 

TOPICS
SDK

Views

187

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 14, 2023 Sep 14, 2023

Copy link to clipboard

Copied

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

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

 

JustinTHyperBrew_0-1694710309111.png

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 22, 2023 Sep 22, 2023

Copy link to clipboard

Copied

LATEST

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines