Forum Replies Created

Page 2 of 2
  • 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

  • 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

  • I do not have CS5 and do not feel like installing the CS5 trial and tweaking the AHK script. You could see if someone at the AutoHotKey forums is interested or someone on your team may be able to do it.

    Here are a some tips:

    o You need a Spy tool so that you can gather data about the Windows controls Premiere is using. The best Spy tool I have found is the AHK script from this forum https://www.autohotkey.com/forum/topic37645.html. I copied the script code to Notepad then saved it as “SpyBySmurth.ahk”. Double click that.ahk file, click the Control tab, then hover over the Premiere control of interest. If Adobe has not made significant changes between CS4 and CS5, the problem probably lies with the y positions of Name field (y=40 in CS4) and the Comments field (y=100 in CS4) in the Marker dialog box. To determine these values for CS5: with SpyBySmurth running and the Control tab active, make the Premiere timeline active, press * on the numeric keypad, hover the mouse over the Name entry field and check the Y value displayed by SpyBySmurth. Do the same for the Comments entry field. Change the values in my Export script to match the displayed values. Hopefully the answer is that simple.

    o Debugging in AHK is not very sophisticated. The most common technique is to include the following two lines before or after the suspect code:
    listvars
    pause

    o For each AHK script which is running, an H icon will appear in the Windows Notification Area (normally in the bottom right of the desktop). Right-clicking on the icon presents various actions. The The listvars command presented above essentially performs the Open action with the View = “Variables and their contents”. Another useful action is Pause Script — if you have paused a script either manually or programmatically (i.e., “pause” command), clicking the Pause Script action will continue execution of the script. The Help action leads to a very comprehensive help file with excellent search capabilities.

    Hope this helps. My apologies to Adam for not responding to his January query. If someone gets this working with CS5, I am sure others would appreciate the updated code being posted.

  • Wil,

    The original code remains unchanged to the best of my recollection.

    However, I needed to go the other direction from my spreadsheet with the time back to the sequence. So the following code let’s the user have the desired sequence active in Premiere, position the cursor in the desired spreadsheet cell containing the time, then press Winkey+Shift+T. The AutoHotKey code then positions Premiere’s CTI at the desired time. This code resides in an AHK file which loads when my system boots so it’s always available.

    #+t:: ; T for Time (Premiere)
    ; Purpose: Copy desired time, switch to Adobe Premiere and move the CTI to the desired time.
    ; 1. Quit any application which may be monitoring the clipboard or disable the application's monitoring
    ; of the clipboard. In my case it was the mediachance.com Multimon Task Bar.
    ; 2. Make sure Premiere focus is in Timeline, Program Monitor, or Reference Monitor for the desired sequence.
    ; 3. Switch to the spreadsheet and select the cell containing desired time. Then press Win+Shift+T.
    ; If the time is not in a spreadsheet cell, select the time text before pressing Win+Shift+T.
    ; The time will consist of all digits in the cell concatenated as if no other characters were in the cell.
    ; This functionality complements the Marker-export logic of the separate script PremiereMarkers.ahk.
    send ^c ; copy cell or text string to clipboard
    ClipWait ; wait for clipboard to contain data
    if WinExist("ahk_class Premiere Pro")
    {
    WinActivate ; give focus to Premiere
    sleep, 500
    send ^+a ; Ctrl+Shift+A to Deselect All so we don't move In points of all selected clips
    Loop, PARSE, Clipboard ; send Numpad characters rather than main keyboard numerics. Ignore non-numeric characters.
    {
    if ( A_LoopField = "0" )
    send {Numpad0}
    else if ( A_LoopField = "1" )
    send {Numpad1}
    else if ( A_LoopField = "2" )
    send {Numpad2}
    else if ( A_LoopField = "3" )
    send {Numpad3}
    else if ( A_LoopField = "4" )
    send {Numpad4}
    else if ( A_LoopField = "5" )
    send {Numpad5}
    else if ( A_LoopField = "6" )
    send {Numpad6}
    else if ( A_LoopField = "7" )
    send {Numpad7}
    else if ( A_LoopField = "8" )
    send {Numpad8}
    else if ( A_LoopField = "9" )
    send {Numpad9}
    }
    Send {NumpadEnter} ; complete entry of desired time
    }
    else MsgBox ,0,Error,Could not locate Premiere window. Therefore desired CTI time could not be entered. (AutoHotKey: Win+Shift+T)
    return

    Not to go off topic on my own thread but I found the following code also useful. This code resides in my boot-up AHK file. It makes small enhancements to three different standard Premiere keyboard shortcuts:

    Shift+1: Open the Project Panel AND POSITION THE CURSOR IN THE FIND FIELD.

    Shift+7: Open the Effects Panel AND POSITION THE CURSOR IN THE FIND FIELD.

    Numpad*: If the marker already exists, open the marker dialog box AND PLACE THE CURSOR IN THE NAME FIELD.

    ; ========================== Adobe Premiere Customizations ==============
    ; see also #+t in Windows Logo Key section
    #IfWinActive ahk_class Premiere Pro
    +1:: ; Shift+1 is standard shortcut for Project panel
    send +1 ; Activate Project panel
    send +f ; Shift+f is the standard shortcut to place cursor in Find box
    return
    +7:: ; Shift+7 is standard shortcut for Effects panel
    send +7 ; activate Effects panel
    send +f ; Shift+f is the standard shortcut to place cursor in Find box
    return
    NumpadMult:: ; Numpad * is the standard shortcut to set an unnumbered Marker or to open the Marker dialog box for an existing marker.
    ; When opening the Marker dialog box, this script places cursor in the Name field, rather than the default of leaving the OK button active.
    ; Tip: While cursor is in Name field, press Enter to close Marker dialog box.
    send {NumpadMult} ; Numpad * send Marker shortcut
    sleep, 100
    if WinExist( "Marker @ " ) ;if Marker dialog box opened rather than creating new marker
    {
    send {Tab} ; six {Tab} move to name field
    send {Tab}
    send {Tab}
    send {Tab}
    send {Tab}
    send {Tab}
    }
    return
    #IfWinActive ; end Adobe Premiere
    ; END END END ========================== Adobe Premiere Customizations ==============

  • Revised to handle double quotes (“) in Name or Comment. Converted to single quotes (‘). This prevents problems when pasting from the Clipboard into the spreadsheet.

    ; 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 y position within the Marker dialog box.
    ; o Probably is language sensitive. The Marker dialog box is found by looking for "Marker @".
    ; o Tested with CS4. Other versions could have minor differences which may prevent the script from working as is.

    ; 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, the 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.

    ; Perhaps this is not important, but I was also unable to figure out how to make the left-most sequence be Sequence0001.
    ; The numbering depends upon what was the last sequence selected in the Timeline before the script began executing. Sequence0001 will be sequence after sending a Shift+3 keysroke.
    ; So, if you want Sequence0001 to correspond to the left-most sequence, select the right-most sequence before running the script. The remaining sequences
    ; will be 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.

    #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
    Send +3 ; give focus to Timeline (Shift+3). If Timeline already has focus, focus will move to next sequence.
    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, hwndControls, ControlListHwnd ;get hwnd's of all controls in Marker dialog box Loop, Parse, hwndControls, `n ;loop thru all of the controls of the Marker dialog box { WinGetClass, controlClass, ahk_id %A_LoopField% if ( controlClass = "Edit" ) { ControlGetPos ,x, y, controlWidth, controlHeight, ,ahk_id %A_LoopField% if ( y = 40 ) ; Name { ControlGetText, markerName, , ahk_id %A_LoopField% StringReplace, markerName, markerName, ", ', All ; replace double quotes with single quote } else if ( y = 100 ) ; Comments { ControlGetText, markerComment, , ahk_id %A_LoopField% StringReplace, markerComment, markerComment, ", ', All ; replace double quotes with single quote } } } 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

  • “display only exact name matches” works for me on XP 32-bit but not on Win7 64-bit.

Page 2 of 2

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