Skip to content

Commit

Permalink
add some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rendertom committed Aug 23, 2020
1 parent 043eb3d commit 0f87b1c
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 10 deletions.
38 changes: 29 additions & 9 deletions docs/application/application.rst
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ Returns 1 if proxy enablement was changed.
app.setExtensionPersistent()
************************************************

``app.setExtensionPersistent(extensionID, persist)``
``app.setExtensionPersistent(extensionID, persistent)``

**Description**

Expand All @@ -701,21 +701,32 @@ Whether extension with the given extensionID persists, within this session.
Argument Type Description
================ =========== =======================
``extensionID`` ``String`` Which extension to modify.
``persist`` ``Integer`` Pass ``1`` to keep extension in memory, ``0`` to allow unloading.
``persistent`` ``Integer`` Pass ``1`` to keep extension in memory, ``0`` to allow unloading.
================ =========== =======================

**Returns**

Returns **true** if successful.

**Example**

.. code:: javascript
var extensionID = 'com.adobe.PProPanel';
// 0 - while testing (to enable rapid reload);
// 1 - for "Never unload me, even when not visible."
var persistent = 0;
app.setExtensionPersistent(extensionID, persistent);
----

.. _app.setScratchDiskPath:

app.setScratchDiskPath()
*********************************************

``app.setScratchDiskPath(path, whichScratchValueToSet)``
``app.setScratchDiskPath(path, scratchDiskType)``

**Description**

Expand All @@ -727,19 +738,28 @@ Specifies the path to be used for one of Premiere Pro's scratch disk paths.
Argument Type Description
========================== =========== =======================
``path`` ``String`` The new path to be used.
``whichScratchValueToSet`` ``type`` Must be one of the following:
``scratchDiskType`` ``Enum`` Enumerated value, must be one of the following:

| ``FirstAudioCaptureFolder``
| ``FirstVideoCaptureFolder``
| ``FirstAudioPreviewFolder``
| ``FirstAutoSaveFolder``
| ``FirstCCLibrariesFolder``
- ``ScratchDiskType.FirstAudioCaptureFolder``
- ``ScratchDiskType.FirstVideoCaptureFolder``
- ``ScratchDiskType.FirstAudioPreviewFolder``
- ``ScratchDiskType.FirstAutoSaveFolder``
- ``ScratchDiskType.FirstCCLibrariesFolder``
========================== =========== =======================

**Returns**

Returns 'true' if successful.

**Example**

.. code:: javascript
var scratchPath = Folder.selectDialog('Choose new scratch disk folder');
if (scratchPath && scratchPath.exists) {
app.setScratchDiskPath(scratchPath.fsName, ScratchDiskType.FirstAutoSaveFolder);
}
----

.. _app.setSDKEventMessage:
Expand Down
13 changes: 13 additions & 0 deletions docs/item/projectitem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ The name of the project item.

String; read/write.

**Example**

Rename first project item.

.. code:: javascript
var item = app.project.rootItem.children[0];
if (item) {
item.name = item.name + ', updated by PProPanel.';
} else {
alert('Could not rename project item');
}
----

.. _projectItem.nodeId:
Expand Down
25 changes: 24 additions & 1 deletion docs/sequence/sequence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,30 @@ Argument Type Description

**Returns**

Returns the new Sequence object, if successful; `0` if unsuccessful.
Returns the new :ref:`sequence`, if successful; `0` if unsuccessful.

**Example**

.. code:: javascript
var sequence = app.project.activeSequence;
if (sequence) {
var numerator = 1;
var denominator = 1;
var motionPreset = 'default'; // 'default', 'faster', 'slower'
var newName = sequence.name + ', auto-reframed.';
var useNestedSequences = false;
var newSequence = sequence.autoReframeSequence(numerator, denominator, motionPreset, newName, useNestedSequences);
if (newSequence) {
alert('Created reframed sequence: ' + newName + '.');
} else {
alert('Failed to create re-framed sequence: ' + newName + '.');
}
} else {
alert('No active sequence');
}
----

Expand Down

0 comments on commit 0f87b1c

Please sign in to comment.