Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe Premiere Pro Export Markers (Solved until Adobe provides something better)

  • Ed Elliott

    August 28, 2011 at 3:27 pm

    Hopefully the revised script below will resolve everyones’ issues. It should work as is for CS4, CS5, CS5.5. And for CS3 by commenting out one line of code.

    If anyone experiences problems with this revised script, please send me your .prproj file. I don’t need the sources.

    I just upgraded from CS4 to CS5.5 and previously had assumed that the problems people were experiencing were related to some change Adobe had made for CS5. It turns out that the issue was related to display sizes — I couldn’t reproduce the problem on my main AV computer with its 2560 x 1600 display but the original script outputted blank Marker Name and Comment on my laptop with its 1280×800 display.

    The only other change is an enhancement to always make the left-most sequence Sequence0001. Previously, the user had to remember to select the right-most sequence if s/he wanted the left-most sequence to be Sequence0001.

    ; Copies to Clipboard the marker time, name, and comments from all markers in all Premiere Timeline sequences.
    ; If the sequence is not in the Timeline, the marker data will not be copied.

    ; Paste this script into a text file with the file extension .ahk (e.g., PremiereMarkers.ahk). Install free AutoHotKey from autohotkey.com. Windows only, not Mac.
    ; Start Premiere and load your project. Double-click on the .ahk file. Do not change the focus by interacting with other programs while the script is running.

    ; Fragility:
    ; o Relies upon some standard keyboard shortcuts, but these are mainstream shortcuts rather than something obscure or likely to be changed.
    ; o Locates the Marker Name and Marker Comment by their class names Edit4 and Edit3 within the Marker dialog box.
    ; o Probably is language sensitive. The Marker dialog box is found by looking for "Marker @".
    ; o Tested with CS4 and CS5.5. Cs3 should work by commenting out one line -- search for CS3 below.
    ; o Unrelated utilities may interfere with clipboard operations and may cause this script to fail. For example I manually turned off
    ; the "Add Multi-Text Clipboard" option in MultiMonitor TaskBar Version 2.1 because of its interference with other programs which
    ; perform clipboard operations. I don't recall whether it interfered with this script but I know it has interfered with at least one
    ; of my custom programs which uses the clipboard so I leave that option turned off.

    ; I was unable to figure out how to extract the name of the sequence so the extracted data just shows Sequence0001, Sequence0002, etc.
    ; One way of documenting the sequence name is to manually create a marker at 00:00:00:00 with the sequence name in the Marker Name field.
    ; The script does not do anything special with the marker at 00:00:00:00.
    ; In addition to researching getting the sequence name from the Timeline, I also researched:
    ; o retrieve it by Alt+W, t, t, Enter, but there is no Edit control in the Window menu to retrieve the name,
    ; o retrieve it from the Project panel, but there is there no "Reveal in Project" command for sequences like there is for a clip.
    ; One possibility which I did not explore was copying the graphical image of the sequence name from the Timeline.

    ; The left-most sequence is always Sequence0001. The remaining sequences are numbered in left-to-right order.

    ; Be careful when making changes. When in doubt, throw in extra whitespace (e.g., WinExist(stringMarker) does not
    ; produce the same result as WinExist( stringMarker )). Sometimes capitalization is important (e.g., AND rather than and). The difference between = and :=
    ; is significant as is the way variables are referenced (variable vs. %variable%). None of these subtleties will generate a compiler error -- just a different result.

    ;********************Change Log ***************************************
    ; 2011.08.28 Fixed bug where output Name & Comment were always empty.
    ; 2011.08.28 Enhancement: Sequence0001 is always the left-most sequence in the Timeline, rather than the user having to remember to select a particular sequence before starting the script.
    ;********************End Change Log ***********************************

    #SingleInstance force ; Skips the dialog box and replaces the old instance of this script automatically
    #NoEnv ; Recommended. Undefined variables (%xxxx%) do not cause a search of Environment variables.

    SetTitleMatchMode 1 ; Must start with
    SetTitleMatchMode fast

    stringMarker := "Marker @ " ; Beginning of title of the Marker dialog box. Used to find the dialog box.

    if WinExist( stringMarker ) ; just in case the user left a marker dialog box open
    WinClose

    Clipboard := "" ; so there's no risk of having left overs in Clipboard in case script does not complete successfully

    if WinExist("ahk_class Premiere Pro")
    {
    WinActivate ; give focus to Premiere
    ; activate first sequence in the Timeline:
    Send !w ; Alt+w to activate menu item "Window"
    Send t ; move to Metadata menu entry. Comment out (;) for CS3 because Metadata is not in the list of Windows.
    Send t ; move to Timeline menu entry
    Send {Enter} ; select Timeline menu entry
    Send {Enter} ; select first sequence in Timeline. Gives focus to first sequence in Timeline.

    firstMarkerTitle := "" ; for determining when we're done
    firstMarkerName := ""
    firstMarkerComment := ""
    countSequence = 1 ; for labeling sequences
    stringClipboard := "" ; for accumulating the text which will be placed in Clipboard. The limit is 64KB (not tested).
    doneWithAllSequences = 0
    While ( doneWithAllSequences = 0 ) ; for each Sequence
    {
    Send {Home} ; move to beginning of Timeline
    ; The next two lines could be omitted. In the case when there is no marker at 00:00:00:00 but there are other markers, they avoid creating a marker then deleting it.
    Send ^{Right} ; Ctrl+RightArrow - move to 1st Marker after 00:00:00:00, if there is one; otherwise, stay at 00:00:00.
    Send ^{Left} ; Ctrl+LeftArrow - move to marker at 00:00:00:00 if it exists; otherwise stay at first marker after 00:00:00:00; if no markers, stay at 00:00:00:00.
    priorMarkerTitle := "" ; for determining right-most marker in a sequence
    doneWithThisSequence = 0
    While ( doneWithThisSequence = 0 ) ; for each Marker
    {
    Send {NumpadMult} ; Num* to open marker dialog box. If no markers in Sequence, we will erroneusly create one at 00:00:00:00.
    ; If we erroneously create one, the dialog box will not be open and we will send Ctrl+0 to delete the marker.
    waitForDialogBox = 0
    iterations = 0
    while ( waitForDialogBox <> 1 AND iterations < 5) ;max wait = 5 * 200ms = 1 second
    if WinExist( stringMarker )
    waitForDialogBox = 1
    else
    {
    sleep 200
    iterations += 1
    }
    if WinExist( stringMarker )
    {
    WinGetTitle, markerTitle ;get Marker dialog box title ("Marker @ 00;00;00;00")
    WinGet, Controls, ControlList, A ;get Names's of all controls in Marker dialog box
    ; Example #3: Extract the individual control names from a ControlList:
    ;Loop, Parse, Controls, `n
    ;{
    ; MsgBox, 4,, Control #%a_index% is "%A_LoopField%". Continue?
    ; IfMsgBox, No
    ; break
    ;}

    markerName := ""
    markerComment := ""
    Loop, Parse, Controls, `n ;loop thru all of the controls of the Marker dialog box
    {
    if ( A_LoopField = "Edit4" ) ;marker Name
    {
    ControlGetText, markerName, %A_LoopField%
    StringReplace, markerName, markerName, ", ', All ; replace double quotes with single quote so pasting to spreadsheet will work correctly
    }
    else
    if ( A_LoopField = "Edit3" ) ; marker Comments
    {
    ControlGetText, markerComment, %A_LoopField%
    StringReplace, markerComment, markerComment, ", ', All ; replace double quotes with single quote so pasting to spreadsheet will work correctly
    }
    }
    WinClose ; Close the Marker dialog box. We'll WinWaitClose below to make sure that it's closed, but in the meantime let's do some processing...
    if ( markerTitle = firstMarkerTitle AND markerName = firstMarkerName AND markerComment = firstMarkerComment ) ; we've probably (not 100% sure) processed all sequences
    {
    doneWithAllSequences = 1 ; we've looped around back to the very first marker. Perform final actions and terminate.
    doneWithThisSequence = 1
    }
    else
    {
    if ( firstMarkerTitle = "" ) ; prepare for detecting when we've processed all markers in all sequences
    {
    firstMarkerTitle := markerTitle
    firstMarkerName := markerName
    firstMarkerComment := markerComment
    }
    if ( markerTitle = priorMarkerTitle ) ; we're reprocessing the right-most marker of the sequence
    doneWithThisSequence = 1 ; move on to next Sequence
    else
    {
    priorMarkerTitle := markerTitle ; prepare for next iteration and determining when we've processed the right-most marker of a sequence
    ; Valid marker. Append sequence id, CTI, Name, & Comment to clipboard string.
    sequenceName := SubStr("000"countSequence, -3)
    markerTime := SubStr(markerTitle, 10, 11) ; extract CTI
    stringClipboard = %stringClipboard%Sequence%sequenceName%%A_Tab%%markerTime%%A_Tab%"%markerName%"%A_Tab%"%markerComment%"`r`n
    }
    }
    WinWaitClose ; wait for Marker dialog box to close
    }
    else
    { ; no markers in this sequence, but we just erroneously created one at 00:00:00:00
    send ^0 ; delete the erroneously-created marker (Ctrl+0)
    doneWithThisSequence = 1 ; move on to next Sequence
    }
    Send ^{Right} ; Ctrl+RightArrow - move to next Marker
    } ; end While ( doneWithThisSequence = 0 )
    Send +3 ; next Sequence (Shift+3)
    countSequence += 1
    } ; end While ( doneWithAllSequences = 0 )
    clipboard := stringClipboard
    MsgBox The list of markers has been placed in the Clipboard. Paste into spreadsheet, word processor, or database. The separator is a tab.
    }
    else MsgBox ,0,Error,Cannot locate Premiere window
    Exit

  • Kevin Perreira

    September 29, 2011 at 10:17 am

    Hi there!

    I tried your method but AutoHotKey doesn’t seems to lunch the script.
    (something flickers in the task tray, but to fast for being indentified)
    Also AutoHotKey seems to work properly with other script (with an icon in the tasktray as long as the script is in use)

    Do you see what could be the problem?
    Is there a way you can help?
    Maybe by sending me the .exe compiled with AutoHotKey?

    Thanx for helping, and excuse my english (I’m french)

    kevin

  • Ed Elliott

    September 29, 2011 at 3:41 pm

    Kevin,

    If you email your .prproj to me at eelliott_at_tritel.net, I will try to figure out the problem. (Replace _at_ with @) I don’t need any source files, just the .prproj.

    Ed

  • Arran Moffat

    September 29, 2011 at 4:59 pm

    Amazing work! Many, many thanks for producing this excellent script.

  • Ed Elliott

    September 30, 2011 at 12:45 pm

    Kevin,

    (I thought that I had sent this reply 12 hours ago but it did not show up in the thread so I am retyping it. I think that I associated the original submission with the uploading of the attached PDF and my reply has gotten lost in the cloud somewhere. Anyway…)

    The most likely cause of the problem is that you are running a non-English version of Premiere. The attached PDF discusses the two areas of the script code which probably require modification for other languages.

    I do not have the French version of Premiere installed and the French version of the Premiere Help PDF does not include the screen snapshots which would have allowed me to modify the code myself.

    The attached PDF contains two Premiere screen snapshots. If you are not comfortable with modifying the code yourself, you can send me the similar snapshots from your French version and I can modify the code. This, of course, is not the best way to do software development and it may take more than one iteration to get it right.

    Besides the two likely culprits discussed in PDF, there are two other less likely causes: (a) common keyboard shortcuts are different in the French Version and (b) low-level naming of software elements is different in the French version. I suspect that (b) is is unlikely. Here I’m referring to such things as the “class” (“Premiere Pro”) and Windows controls such as “Edit3” and “Edit4” in the Marker dialog. If, for example, there was a problem with “class” you would have seen a popup that the script could not find a Premiere session. I mention (a) and (b) now only to set the expectation that the two likely causes discussed in the PDF might not totally resolve the issues with the French version of Premiere. But with some persistence we should be able to get it working. If the PDF does not get the script working, for example, I suggest looking at each Send command in the script and testing it from the keyboard, e.g., does Home move to the beginning of the Timeline; does Ctrl+RightArrow move to the next marker; does Ctrl+LeftArrow move to the previous marker; does Numpad * create new Marker and open existing Marker; etc.

    Sorry that I do not speak French. Hopefully the above is relatively easy to understand.

    Ed

    3007_premieremarkerslanguagesensitivity.pdf.zip

  • Kevin Perreira

    October 1, 2011 at 12:51 pm

    Hi Ed,
    Thanks a lot for your help and disponibility, I wish I could be as quick as you are. Seriously I really appreciate your hand with that issue, and that’s very kind of you that you wrote your message twice.
    I just read the PDF which is certainly very helpful:
    Actually the French version is very different

    (1) “Marker @” is replaced by “Marqueur à”
    I will try replace it automaticaly in the script but “à” may not be an authorised sign for the script, is it?

    (2) and (a) I just checked Menus and Keyboard shotcuts on my french version: there’s nothing like in your PDF. Obviously “Windows” is called “Fenêtre” but without underligned “F” / without “Alt+F” shortcut.So I think I will create US keybord shortcuts, and save them especially for running the script. Otherwise I wonder if I might find quickly a .kys file with the US shortcuts. Maybe you hcan create it for me by simply making a copy of the defaut shortcuts? (that should be in C:Users/YOURNAMEHERE/AppData/Roaming/AdobePremiere Pro/5.5)

    (b)I don’t get very well the “class issue”: besides my poor english, I’m not familiar with writing scripts, but anyway I can assure you that there was no popup at all after lunching the script.

    So now I do some tests, and I keep you in touch
    Thanx again Ed, you’re great!

    Kev

  • Kevin Perreira

    October 1, 2011 at 2:34 pm

    Now I understand that moving to a menu entry by using “Alt” key is different that using a shortcut, and it seems there is no parameter for that, and no way to do it with the French version.
    I must admit that was already visible in the PDF you sent me, where I can see by instance: that “Effects” has one shortcut which is “Shift+7” AND ALSO one “move to menu entry-shortcut” which is “Alt+f” , right?
    So I switched my keyboard to QWERTY (instead of AZERTY), restarted Premiere, but still: “Alt+W” doesn’t gave me the “Window” menu. Also I read that changing CS langage supposse to buy another licence.
    These “Alt+” shortcuts for moving in the menus are not in my other french Adobe softwares, but I can use them without problems in other programs like thunderbird or firefox.

    I don’t see any way to have these “Alt+” shortcuts in my french CS 5.5 , and I guess the only way to procede is to compile your script in a exe file and find a PC user who has PPRO cs5.5 in english with the default shortcuts.

    What’s your opinion Ed?
    Thanks a lot for you help.

    Kev

  • Ed Elliott

    October 1, 2011 at 9:57 pm

    Kevin and I got the script working in the French version of Premiere. Testing indicates that the only language-dependent item is the “Marker” text which appears in the top-left of the Marker dialog box. There is now an additional line (presently commented out) in the code for “Marque”.

    Also, I reversed a previous change which was intended to make the left-most sequence in the Timeline the first sequence output to the clipboard. While working on Kevin’s problem I discovered that the earlier change was NOT working as intended because Premiere is sorting the sequences in alphabetical order before displaying them in the Window > Timeline menu. Another downside of this previous change was that the keystrokes used to bring up the Window > Timeline menu vary by language; so reversing the change made it simpler to port the script to other languages. And this latest script works as is with CS3 (the previous version required commenting out one line).

    The above change means that the script is back to its original logic, i.e., if you have multiple sequences in the Timeline and you want the left-most sequence to be the first sequence output to the clipboard, you should make the right-most sequence active (click on it) before executing the script.

    The revised script works as-is with the English-language version of Premiere CS5.5/CS5/CS4/CS3 (earlier versions have not been tested). For the French-language version of Premiere, one line will have to be uncommented (i.e., use Notepad to remove the semi-colon):
    3014_premieremarkers.ahk.zip

    The PDF which I uploaded for Kevin a couple days ago is now only relevant regarding the text at the top-left of the Marker dialog box. The stuff at the bottom-left of the PDF about the Premiere main menu (Alt+w, t, t, {Enter}, {Enter}) is NO LONGER RELEVANT. As discussed above that code has been replaced with a simpler, language-independent Shift+3 to activate the Timeline.

  • Ed Elliott

    October 2, 2011 at 1:44 am

    The link I posted couple hours ago should work fine for English and French users. The version posted below will also work fine for English and French users. Anyone converting the script for another language version should definitely use the version below.

    3017_premieremarkers.ahk.zip

    This version revises the way a Marker’s CTI (time) value is extracted from the Marker’s title. The prior version counted characters from left-to-right, which worked fine for the English and French versions because “Marker @ ” and “Marque a ” have the same number of characters. Other languages could use longer or shorter titles. The revised version counts characters from right-to-left (i.e., from the end of the title) so the logic is now language independent and extracts the right-most 11 characters as the CTI.

  • Kevin Perreira

    October 2, 2011 at 8:27 am

    Hi Ed,
    Even if we discussed by email,
    I’d like to thank you very much in the official thread, and say to users of french PPRO that: Yes! Your script works very well now!
    It’s absolutely amazing!

    kev

Page 2 of 5

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy