Skip to main content
Participant
August 14, 2026

Bug: Transcript.createImportTextSegmentsAction + executeTransaction melden Erfolg, committen aber nichts

  • August 14, 2026
  • 2 replies
  • 13 views

Bug: Transcript.createImportTextSegmentsAction + executeTransaction melden Erfolg, committen aber nichts

Umgebung

  • Premiere Pro Version: 26.3.0 (Manifest minVersion), UXP Manifest v5
  • API: @adobe/premierepro UXP-Bindings (ppro-Namespace)

Erwartetes Verhalten

ppro.Transcript.createImportTextSegmentsAction(textSegments, clipProjectItem) erzeugt eine Action, die per project.executeTransaction() committet wird und das Transkript am ClipProjectItem anhängt - äquivalent zu Text-Panel → Overflow-Menü → Import → Import Static Transcript.

Tatsächliches Verhalten

Jede einzelne Stufe der Kette meldet Erfolg, aber ppro.Transcript.hasTranscript(clipProjectItem) und die UI (Text-Panel) zeigen übereinstimmend, dass kein Transkript angekommen ist.

Minimal-Reproduktion

const project = await ppro.Project.getActiveProject();
const sequence = await project.getActiveSequence();
const track = await sequence.getAudioTrack(0);
const trackItems = await track.getTrackItems(ppro.Constants.TrackItemType.CLIP, false);
const projectItem = await trackItems[0].getProjectItem();
const clipProjectItem = ppro.ClipProjectItem.cast(projectItem);

const testJson = JSON.stringify({
language: "de-de",
segments: [{
start: 0, duration: 1, language: "de-de",
speaker: "631fbbc0-9c02-47c4-bb8c-732c020fa24f",
words: [{ confidence: 1, duration: 1, eos: true, start: 0, tags: [], text: "Test", type: "word" }]
}],
speakers: [{ id: "631fbbc0-9c02-47c4-bb8c-732c020fa24f", name: "Test" }]
});

const textSegments = await ppro.Transcript.importFromJSON(testJson);

await project.lockedAccess(() => {
const action = ppro.Transcript.createImportTextSegmentsAction(textSegments, clipProjectItem);
const success = project.executeTransaction((compoundAction) => {
compoundAction.addAction(action);
}, "Transkript importieren");
console.log("executeTransaction:", success); // -> true
});

const check = await ppro.Transcript.hasTranscript(clipProjectItem);
console.log("hasTranscript:", check); // -> false (erwartet: true)

Was bereits einzeln verifiziert wurde (jeweils mit Erfolgsmeldung, ohne Wirkung)

Schritt Ergebnis
ppro.Transcript.importFromJSON(json) Liefert TextSegments {}-Objekt, kein Fehler
ppro.Transcript.createImportTextSegmentsAction(textSegments, clipProjectItem) Liefert Action {}-Objekt mit korrektem Konstruktor, kein Fehler
compoundAction.addAction(action) (innerhalb executeTransaction) Rückgabewert true
project.executeTransaction(callback, undoString) Rückgabewert true
ppro.Transcript.hasTranscript(clipProjectItem) danach false
Dieselbe Prüfung mit frisch neu geholtem ClipProjectItem (falls stale Referenz) Ebenfalls false
Clip vorher explizit via ppro.SourceMonitor.openProjectItem() geöffnet Kein Unterschied
Getestet mit synthetischem 1-Wort-JSON UND mit echtem Inhalt (154 Wörter, 2 Sprecher, mehrere Segmente) Kein Unterschied
Getestet gegen ClipProjectItem eines regulären Medien-Clips UND gegen das (via sequence.getProjectItem() + ClipProjectItem.cast()) gecastete ProjectItem einer Sequenz selbst (isSequence() bestätigt true) Kein Unterschied
Manueller Import derselben JSON-Datei über Text-Panel → Import Static Transcript Funktioniert einwandfrei

Schlussfolgerung

Das JSON-Format ist korrekt (manueller Import bestätigt dies zweifelsfrei). Der Fehler liegt ausschließlich in der programmatischen Kette createImportTextSegmentsAction / executeTransaction für Transcript-Actions - vermutlich commitet die Transaktion intern nicht korrekt für diesen spezifischen Action-Typ, obwohl der Rückgabewert Erfolg suggeriert.

    2 replies

    Amy the Stuv
    Community Manager
    Community Manager
    August 14, 2026

    Hello ​@happy_glamour0ed0 

    Welcome to the Premiere Forums. It can always help us to know a little about your system if you wouldn’t mind telling us the following in addition to the information provided for our records. 

    • Operating System: Specify Windows or macOS, along with the version.
    • Chip (Mac Only): Specify the M series chip or CPU and GPU if intel
    • GPU and Driver (Windows only): Please let us know your video card and driver version. We recommend updating to the most recent version; for NVIDIA users, we strongly recommend the Studio version of the driver.

    The official reference for Transcript.importFromJSON shows a different signature than you're using — it returns a boolean and delivers the parsed segments through a callback parameter, not through the return value:
    importFromJSON(json: string, callback: (importedTranscription: TextSegments) => void): boolean
    (source)

    Since your code never passes a callback, textSegments is likely an empty/unpopulated placeholder object — which would explain why every downstream step (createImportTextSegmentsAction, executeTransaction) reports success: they're operating on valid-but-empty data. Try:

     

    let textSegments;
    ppro.Transcript.importFromJSON(testJson, (imported) => {
    textSegments = imported;
    });

    You may need to wrap that in a Promise if the callback fires asynchronously — worth testing both ways.

     

    Let me know if this works or returns an error. I’m reaching out internally to double check.

    Best,

    Amy

    Participant
    August 14, 2026

    Operating System: Windows 11 Pro, 25H2 GPU and Driver: NVIDIA RTX 4090, Studio-Treiber 610.88

    Hi Amy, danke für den Hinweis! Hab's getestet, leider ohne Erfolg – der Callback feuert nicht, auch nach 5 Sekunden Timeout nicht. Der synchrone Rückgabewert von importFromJSON ist bereits ein TextSegments-Objekt (nicht ein Boolean), was eher zur einparametrigen Signatur aus der TypeScript-Deklaration passt (importFromJSON(jsonString: string): TextSegments) als zur Callback-Variante von der Doku-Seite. Die Doku-Seite scheint für diese Methode veraltet zu sein.

    Der eigentliche Bruch bleibt also weiterhin zwischen createImportTextSegmentsAction/executeTransaction (beide melden Erfolg) und hasTranscript()/der UI (zeigen "nichts angekommen"), unabhängig vom Import-Signatur-Detail. Freu mich, wenn intern noch jemand draufschauen kann!