Skip to content

Instantly share code, notes, and snippets.

@alexanderklatt
Created May 5, 2020 18:39
Show Gist options
  • Select an option

  • Save alexanderklatt/c3976037c646d7172c89a90a75a6920b to your computer and use it in GitHub Desktop.

Select an option

Save alexanderklatt/c3976037c646d7172c89a90a75a6920b to your computer and use it in GitHub Desktop.
AHK Vod Renamer
NumpadAdd::
if FileExist("D:\Gameplay Footage\Live\TestFolder\Live*.mp4")
InputBox, UserInput, Vod File Name, Enter a file name., , 400, 125
if ErrorLevel
MsgBox, CANCEL was pressed.
else
FileMove, D:\Gameplay Footage\Live\TestFolder\Live*.mp4, D:\Gameplay Footage\Live\TestFolder\%UserInput%.mp4
if WinExist("VALORANT")
WinActivate
@alexanderklatt

Copy link
Copy Markdown
Author

I use this AHK script to immediately rename video clips that I save using the Geforce Experience overlay with a more meaningful name rather than a generated one. This simplifies my editing process later on.

Usage:
-Set whatever hotkey you want to use on line 1 before the ::
-Set your recording directory and the generated file pattern you want to rename on lines 3 and 7
-Set your window title to restore (if you are not running windowed mode) on line 8

There are probably tons of ways to improve this, but even as is it saves me a lot of time. This assumes you are renaming each clip immediately after you save it, so there should only ever be one generated clip matching your FileExists pattern.

TODO: improve this to scan for the most recently generated file matching a pattern.

@mcanning

mcanning commented May 5, 2020

Copy link
Copy Markdown

Gets latest files with default name:

*F11::
Folder = D:\Game Recordings\valorant-win64-shipping.exe\Test\
FileRegex = valorant.*.mp4
    File := ""
    Time := ""
    Loop, Files, %Folder%*.*, DF ; include files and folders
    {	
        If RegExMatch(A_LoopFileName, FileRegex) {
            If (A_LoopFileTimeModified >= Time) {
                Time := A_LoopFileTimeModified        ; the time the file/folder was last modified
                File := A_LoopFileFullPath            ; the path and name of the file/folder currently retrieved
            }
        }
    }
    If (File == "") {
	MsgBox, No matching files found in %Folder%
    }
    else {
        InputBox, UserInput, Vod File Name, Replace: %File%, 200, 800
        if ! ErrorLevel
            FileMove, %File%, %Folder%%UserInput%.mp4
            if WinExist("VALORANT")
                WinActivate 
    }
return

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment