I am working on a george script that duplicates the current clip then moves to the new clip. I though it would be something like;
Code: Select all
tv_clipselect tv_clipcurrentid+1
Any help would be greatly appreciated
Code: Select all
tv_clipselect tv_clipcurrentid+1
Code: Select all
tv_clipcurrent //this is a function which gives you the ID of the current clip
curClipID = Result // then you need to feed the result in a variable. I called it "curClipID", but you could name it "sausage" too
PRINT "CurrentClipID = "curClipID //This line will generate a pop-up-window which show the ID. It's not necessary but always good to see you really definied your variable while working on a script
Code: Select all
tv_clipselect curClipID+1
Code: Select all
tv_clipcurrentid //finds current clip's ID
ClipID = result // stores it in the variable ClipID
//Starting a loop to find current clip position
ClipPos = 0 //start the loop with clip at position 0
tv_ClipEnumID -1 ClipPos
PosID = result //gets clip's ID of the first clip
While (CMP(PosID, ClipID)==0) //I just add 1 to the clip position until the current clip ID matches the ID of the position
ClipPos = ClipPos+1
tv_ClipEnumID -1 ClipPos
PosID = result
END
//Last ClipPos variable is now current clip position
tv_clipduplicate ClipID //duplicates current clip
NextClipPos = ClipPos + 1 //you choose the position you want to go to, here 1 position forward
tv_ClipEnumID -1 NextClipPos //gets the ID of the clip at the position you want to go to
tv_ClipSelect result //goes 1 clip forward
Code: Select all
#Function Otano_ClipCurrentPos()
LOCAL ClipID ClipPos PosID
tv_clipcurrentid
ClipID = result
ClipPos = 0
tv_ClipEnumID -1 ClipPos
PosID = result
While (CMP(PosID, ClipID)==0)
ClipPos = ClipPos+1
tv_ClipEnumID -1 ClipPos
PosID = result
END
result = ClipPos
#End
#Function Otano_ClipPos(ClipID)
LOCAL ClipPos PosID
ClipPos = 0
tv_ClipEnumID -1 ClipPos
PosID = result
While (CMP(PosID, ClipID)==0)
ClipPos = ClipPos+1
tv_ClipEnumID -1 ClipPos
PosID = result
END
result = ClipPos
#End
#Function Otano_ClipCount()
LOCAL ClipPos PosID
ClipPos = -1
DO
ClipPos = ClipPos+1
tv_ClipEnumID -1 ClipPos
PosID = result
Until CMP(PosID,"none") == 1
result = ClipPos
#End
#Function Otano_ClipIsExtreme(ClipID)
LOCAL clipPos clipCount clipState
Otano_ClipPos(ClipID)
clipPos=result
IF ClipPos == 0
clipState = Start
Else
Otano_ClipCount()
clipCount = result
IF clipCount-1 == clipPos
clipState = End
Else
clipState = none
End
End
result=clipState
#End
#Function Otano_EditingInfo()
LOCAL a FirstFrame LastFrame TotalLength EditStart EditEnd EditLength ClipID ClipPos MarkInFrame MarkInState MarkOutFrame MarkOutState
//Collecting Clip Infos
tv_clipinfo
PARSE result a a a a a a a a a a a FirstFrame a LastFrame a TotalLength a EditStart a EditEnd a
EditLength = EditEnd - EditStart +1
tv_clipcurrentid
ClipID = result
//Findind Clip Posistion
Otano_ClipCurrentPos()
ClipPos = Result
//Findind and Setting Mark In/Out Infos
tv_MarkIn clip
parse result MarkInFrame MarkInState
tv_MarkOut clip
parse result MarkOutFrame MarkOutState
IF (CMP(MarkInState, "set ")==1)
MarkInState = 1
ELSE
MarkInState = 0
End
IF (CMP(MarkOutState, "set ")==1)
MarkOutState = 1
ELSE
MarkOutState = 0
End
//result
result = ClipPos" "ClipID" "FirstFrame" "Lastframe" "MarkInState" "MarkOutState" "MarkInFrame" "MarkOutFrame" "TotalLength" "EditLength
#End
#Function Otano_NextClip()
LOCAL OriginalClipPos OriginalClipID a NextClipPos NextClipID ClipExtremeState
Otano_EditingInfo()
PARSE result OriginalClipPos OriginalClipID a
Otano_ClipIsExtreme(OriginalClipID)
Parse result ClipExtremeState
IF CMP(ClipExtremeState,"End")==1
NextClipPos = 0
tv_ClipEnumID -1 NextClipPos
NextClipID = result
ELSE
NextClipPos = OriginalClipPos + 1
tv_ClipEnumID -1 NextClipPos
NextClipID = result
END
tv_ClipSelect NextClipID
result = OriginalClipPos" "OriginalClipID" "NextClipPos" "NextClipID
#End
#Function Otano_PreviousClip()
LOCAL OriginalClipPos OriginalClipID a PreviousClipPos PreviousClipID ClipExtremeState
Otano_EditingInfo()
PARSE result OriginalClipPos OriginalClipID a
Otano_ClipIsExtreme(OriginalClipID)
Parse result ClipExtremeState
IF CMP(ClipExtremeState,"Start")==1
Otano_ClipCount()
PreviousClipPos = result - 1
tv_ClipEnumID -1 PreviousClipPos
PreviousClipID = result
ELSE
PreviousClipPos = OriginalClipPos - 1
tv_ClipEnumID -1 PreviousClipPos
PreviousClipID = result
END
tv_ClipSelect PreviousClipID
result = OriginalClipPos" "OriginalClipID" "PreviousClipPos" "PreviousClipID
#End
#Function Otano_NextClipSkipHidden()
LOCAL OriginalClipPos OriginalClipID a NextClipPos NextClipID ClipExtremeState
Otano_EditingInfo()
PARSE result OriginalClipPos OriginalClipID a
NextClipPos = OriginalClipPos
tv_ClipEnumID -1 NextClipPos
NextClipID = Result
DO
Otano_ClipIsExtreme(NextClipID)
Parse result ClipExtremeState
IF CMP(ClipExtremeState,"End")==1
NextClipPos = 0
tv_ClipEnumID -1 NextClipPos
NextClipID = result
ELSE
NextClipPos = NextClipPos + 1
tv_ClipEnumID -1 NextClipPos
NextClipID = result
END
tv_clipHidden NextClipID
Hidden = result
Until Hidden == 0
tv_ClipSelect NextClipID
result = OriginalClipPos" "OriginalClipID" "NextClipPos" "NextClipID
#End
#Function Otano_PreviousClipSkipHidden()
LOCAL OriginalClipPos OriginalClipID a PrevClipPos PrevClipID ClipExtremeState
Otano_EditingInfo()
PARSE result OriginalClipPos OriginalClipID a
PrevClipPos = OriginalClipPos
tv_ClipEnumID -1 PrevClipPos
PrevClipID = Result
DO
Otano_ClipIsExtreme(PrevClipID)
Parse result ClipExtremeState
IF CMP(ClipExtremeState,"Start")==1
Otano_ClipCount()
PrevClipPos = result - 1
tv_ClipEnumID -1 PrevClipPos
PrevClipID = result
ELSE
PrevClipPos = PrevClipPos - 1
tv_ClipEnumID -1 PrevClipPos
PrevClipID = result
END
tv_clipHidden PrevClipID
Hidden = result
Until Hidden == 0
tv_ClipSelect PrevClipID
result = OriginalClipPos" "OriginalClipID" "PrevClipPos" "PrevClipID
#End
Code: Select all
// ClipDup.grg
// Svengali © 2016
// duplicates currentclip and selects the new duplicate
// (Oct) 2016 - ver .0
Param none
ScriptName = "ClipDup"
tv_LockDisplay quiet
tv_ClipCurrentID
OrigID = result // get the original clip ID
tv_ClipDuplicate // duplicate the original clip
ClipFlag = 1 // set flag true
ClipCounter = 0 // init counter
While ClipFlag // loop while flag is true
tv_ClipEnumID -1 ClipCounter // get ID for each clip
ClipID = result // store ID for current clip
ClipCounter = ClipCounter + 1 // increment counter
IF CMP(ClipID,OrigID) // is this the original clip?
tv_ClipEnumID -1 ClipCounter // get ID for duplicate clip
DupID = result // store ID for duplicate clip
tv_ClipSelect DupID // select duplicate clip
ClipFlag = 0 // set flag to false
END
END
tv_UnLockDisplay
Code: Select all
//LDS George Script
//By Darren M. OConnell
//Code Contributed by Svengali
//This script locks all layers, duplicates the current clip, and then saves the project
//The askSave() will prompt the user for location each time it runs
FUNCTION clipSelect()
tv_clipcurrentid //finds current clip's ID
ClipID = result // stores it in the variable ClipID
//Starting a loop to find current clip position
ClipPos = 0 //start the loop with clip at position 0
tv_ClipEnumID -1 ClipPos
PosID = result //gets clip's ID of the first clip
While (CMP(PosID, ClipID)==0) //I just add 1 to the clip position until the current clip ID matches the ID of the position
ClipPos = ClipPos+1
tv_ClipEnumID -1 ClipPos
PosID = result
END
//Last ClipPos variable is now current clip position
NextClipPos = ClipPos + 1 //you choose the position you want to go to, here 1 position forward
tv_ClipEnumID -1 NextClipPos //gets the ID of the clip at the position you want to go to
tv_ClipSelect result //goes 1 clip forward
END
//Locks all Layers, Duplicates current clip, then changes to new clip
FUNCTION lockDup()
ExitFlag = 0
Counter = 0
While ExitFlag == 0
tv_LayerGetID Counter
LayerID = result
IF CMP(LayerID, "none")
Total = Counter - 1
ExitFlag = 1
ELSE
//tv_LayerInfo LayerID
tv_layerlock LayerID on
END
Counter = Counter + 1
END
tv_clipduplicate tv_clipcurrentid
clipSelect()
END
//Turn of Layer Locks Off On Current Clip
FUNCTION lockOff()
ExitFlag = 0
Counter = 0
While ExitFlag == 0
tv_LayerGetID Counter
LayerID = result
IF CMP(LayerID, "none")
Total = Counter - 1
ExitFlag = 1
ELSE
tv_layerlock LayerID off
END
Counter = Counter + 1
END
END
//Script Main
lockDup()
lockOff()