Copy link to clipboard
Copied
Is it possible to change Adobe Premiere Preferences using ExtendScript?
Specifically looking to control Preferences > Media > Timecode and choose from one of the three available options using ExtendScript.
This seems to work here:
var prefToModify = 'BE.Prefs.General.ClipInOutWithMediaOffset';
var appProperties = app.properties;
if (appProperties){
var propertyExists = app.properties.doesPropertyExist(prefToModify);
var propertyIsReadOnly = app.properties.isPropertyReadOnly(prefToModify);
var originalValue = app.properties.getProperty(prefToModify);
appProperties.setProperty(prefToModify, false, 1, 2); // optional 3rd param : 0 = non-persistent, 1 = persistent (default)
var safetyCheck =
...Copy link to clipboard
Copied
Yes, some-but-not-all prefs are scriptable.
For that pref, I see two choices; 'start at 00:00:00:00' and 'Use Media Source'...what third option do you see?
Copy link to clipboard
Copied
You're right. Typo on my end. Only those two.
Copy link to clipboard
Copied
This seems to work here:
var prefToModify = 'BE.Prefs.General.ClipInOutWithMediaOffset';
var appProperties = app.properties;
if (appProperties){
var propertyExists = app.properties.doesPropertyExist(prefToModify);
var propertyIsReadOnly = app.properties.isPropertyReadOnly(prefToModify);
var originalValue = app.properties.getProperty(prefToModify);
appProperties.setProperty(prefToModify, false, 1, 2); // optional 3rd param : 0 = non-persistent, 1 = persistent (default)
var safetyCheck = app.properties.getProperty(prefToModify);
if (safetyCheck == 'false'){
alert("Now using 00:00:00:00 for media start time.");
} else {
alert("Now adopting start time from media source.");
}
} else {
alert("Properties not found.");
}
Copy link to clipboard
Copied
Brilliant.
Will test soon
Is there a listing of Preference Properties somewhere?
Here are some others that leap to mind for that would come in handy:
Preferences > Timeline > Video Transition Default Duration
Preferences > Timeline > Audio Transition Default Duration
Preferences > Playback > Video Device
File > Project Settings > General > Display the project item name and label color for all instances
UPDATE
Listing of properties in file "Adobe Premiere Pro Prefs" where you can find "Video" as well as "Audio Default Duration" and many more.
Correct?
SLIGHT ISSUE
Updating "BE.Prefs.General.ClipInOutWithMediaOffset" does not immediately change the time code in the currently loaded source monitor.
It needs to be re-loaded. Question: Is there a way to "refresh" the source monitor programmatically to achieve this?
QUESTION
RE "appProperties.setProperty(prefToModify, false, 1, 2); // optional 3rd param : 0 = non-persistent, 1 = persistent (default)"
I get the 1st, 2nd & 3rd parameters. What's the 4th?
QUESTION
Is it possible for ExtendScript to change File > Project Settings > General > Display the project item name and label color for all instances
Copy link to clipboard
Copied
Is there a listing of Preference Properties somewhere?
No; PPro doesn't write all prefs into the prefs file; only those that vary from default.
Recommended approach:
[That's how I found the Media --> Timecode display you referenced.]
Is there a way to "refresh" the source monitor programmatically to achieve this?
I don't think so; having the user change workspaces might do it.
Is it possible for ExtendScript to change File > Project Settings > General > Display the project item name and label color for all instances
No; that's a project setting, not a pref. The API does offer control over scratch disk paths, and the label color of each projectItem.
What's the 4th?
Just classic off-by-one error, like your three options for the original pull-down. It should read 'optional 3rd parameter'.
Copy link to clipboard
Copied
https://forums.adobe.com/people/Bruce+Bullis wrote
Is there a listing of Preference Properties somewhere?No; PPro doesn't write all prefs into the prefs file; only those that vary from default.
Recommended approach:
- copy your PPro prefs --> 'prefs copy'.
- Launch PPro.
- Change ONLY the pref in which you're interested.
- Close PPro.
- Use a file diffing utility to compare current prefs with 'prefs copy'.
Great! Helpful.
Is there a way to "refresh" the source monitor programmatically to achieve this?I don't think so; having the user change workspaces might do it.
Another potentially effective use of the yet-to-be-invented Load Project Item in Source Panel (Is it possible to load a bin item in the Source or Program Panel? ), assuming programmatically loading a different item and then re-loading the prior would effectively update the source panel's timecode.
Is it possible for ExtendScript to change File > Project Settings > General > Display the project item name and label color for all instancesNo; that's a project setting, not a pref. The API does offer control over scratch disk paths, and the label color of each projectItem.
Suggesting as a feature request: It would be valuable to be able to toggle the Timeline to show Project Item names vs Clip Item names at the click of a button.
What's the 4th?Just classic off-by-one error, like your three options for the original pull-down. It should read 'optional 3rd parameter'.
It does read 'optional 3rd parameter'. It's just that there's also a mysteriously unexplained 4th parameter listed in your example above and on other CEP Sample pages
(appProperties.setProperty(prefToModify, false, 1, 2); // What's that "2" all about?)
Copy link to clipboard
Copied
It's a comment bug; my comment should refer to the fourth parameter.
Copy link to clipboard
Copied
https://forums.adobe.com/people/Bruce+Bullis wrote
It's a comment bug; my comment should refer to the fourth parameter.
In that case, what's the 3rd parameter?
appProperties.setProperty(prefToModify, false, 1, 2)
Current understanding is as follows:
Parameter 1: prefToModify
Parameter 2: Value you want to set that pref to.
Parameter 3: Either this is the persistence parameter -- and Parameter 4 is a mystery parameter
Parameter 4: Or this is the persistence parameter -- and Parameter 3 is the mystery parameter.
Copy link to clipboard
Copied
From the code behind the call (I'll update the sample and docs):
param 1 = "Which Preference key are we modifying?"
param 2 = "What is the new value for that preference?"
param 3 = "Should this value persist?"
param 4 = "Should this value be created in the prefs, even if no value was present before?"