Skip to content

Instantly share code, notes, and snippets.

@wiiaboo
Created March 2, 2011 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wiiaboo/850977 to your computer and use it in GitHub Desktop.
Save wiiaboo/850977 to your computer and use it in GitHub Desktop.
# Macro for AvsPmod
# Adds trim(n,n) for every bookmark
bookmarks = avsp.GetBookmarkList()
bookmarks.sort()
avsp.InsertText("\n")
bkNum = len(bookmarks)
def trim(first,last,n):
return "Trim(%d,%d)%s" % (first, last-1, n)
if bkNum > 1:
avsp.InsertText(trim(bookmarks[0],bookmarks[1],"++"))
for i in range(1,bkNum-1):
avsp.InsertText(trim(bookmarks[i],bookmarks[i+1],"++"))
avsp.InsertText(trim(bookmarks[-1],avsp.GetVideoFramecount(),""))
elif bkNum == 1:
avsp.InsertText(trim(bookmarks[0],avsp.GetVideoFramecount(),""))
else:
avsp.MsgBox("Must set at least one bookmark")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment