You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a a relatively better script than vlc-delete that I wrote using AutoHotkey (v2+) that not only works when VLC is in true full-screen mode, unlike vlc-delete, but this script also allows using multiple customizable hotkeys to do the following:
Delete the video to recycle bin (default shortcut key:DEL)
Delete the video permanently from disk (default shortcut key:SHIFT+DEL)
Move the video file to an arbitrary location e.g. C:\ (default shortcut key:CTRL+Z)
I added a lot of code comments for your convenience. And, the default shortcut keys can be changed easily to whatever you want, as seen in the code below.
; Delete/Move a playing VLC video (via hotkeys) then jumps to the next video in the playlist.; ------------------------------------------; DEL = Delete video to the recycle bin; SHIFT+DEL = Permanently delete video of disk; CTRL+Z = Move video to arbitrary location; ------------------------------------------
MOVE_ACTION_DIR := "C:\"
MEDIA_INFO_DIALOG_TITLE := "Current Media Information"
WAIT_FOR_MEDIA_INFO_DIALOG_SECS := 0.25
WAIT_FOR_MEDIA_INFO_DIALOG_RETRIES := 10
CLIPBOARD_WAIT_SECS := 1
WAIT_FOR_NEXT_VID_SECS := 0.10
WAIT_FOR_NEXT_VID_RETRIES := 10
GIVE_BACK_MOUSE_CONTROL_AFTER_SECS := 5#Requires AutoHotkey >=2.0#SingleInstance Force#HotIf WinActive("ahk_class Qt5QWindowIcon") ; only trigger the use of hotkeys if a VLC window is active~Shift & Delete:: { ; SHIFT+DEL = Permanently delete video off diskKeyWait"Delete", "Up"KeyWait"Shift", "Up"
DoPermDelete()
Return
}
~Delete:: { ; DEL = Delete video to the recycle binKeyWait"Delete", "Up"
DoRecycleDelete()
Return
}
~Ctrl & z:: { ; CTRL+Z = Move video to arbitrary locationKeyWait"Ctrl", "Up"KeyWait"z", "Up"
DoMove(MOVE_ACTION_DIR)
Return
}
DoAction(action) {
BlockInput"MouseMove" ; block user from using the mouseSetTimer AllowMouse, GIVE_BACK_MOUSE_CONTROL_AFTER_SECS *1000 ; restore the mouse for the user at some point if something goes wrong
vlcTitle := WinGetTitle("A") ; vlc should be the active window because it's the only way this line got called
isFullScreen := false ; open the media information dialogSend"^i" ; CTRL+I is harcoded in vlc to open the media info dialogif!WinWait(MEDIA_INFO_DIALOG_TITLE, , WAIT_FOR_MEDIA_INFO_DIALOG_SECS) {
; cant find information window - vlc in fullscreen? ; attempt to leave fullscreen and retry opening information dialogSend"{ESC}" ; leave fullscreenSleep10Send"^i"
isFullScreen := true ; user was indeed in fullscreen - remember so we can restore it laterretry := 1while!WinWait(MEDIA_INFO_DIALOG_TITLE, , WAIT_FOR_MEDIA_INFO_DIALOG_SECS) {
retry++ifretry == WAIT_FOR_MEDIA_INFO_DIALOG_RETRIES { ; something went wrong.Msgbox"Can't find Media Information dialog. Aborting!"Return
}
Send"^i"
}
}
; save the full path (as seen in the information dialog) of the video that is playing to the clipboardMouseGetPos&orgMouseX, &orgMouseY
orgClipboardContent := ClipboardAll()
WinActivate MEDIA_INFO_DIALOG_TITLE
WinWaitActive MEDIA_INFO_DIALOG_TITLE
WinGetPos , , &width, &height, MEDIA_INFO_DIALOG_TITLE
fileLocationX := width/2
fileLocationY := height-52CoordMode"Mouse", "Window"MouseMove fileLocationX, fileLocationY, 1Click3 ; selects the entire pathSend"^c" ; copies the path to the clipboardCoordMode"Mouse", "Screen"MouseMove orgMouseX, orgMouseY, 1if!ClipWait(CLIPBOARD_WAIT_SECS) {
WinClose MEDIA_INFO_DIALOG_TITLE
WinWaitClose MEDIA_INFO_DIALOG_TITLE
MsgBox"Can't delete/move file! Problem finding file location nside Media Information dialog."Return
}
WinClose MEDIA_INFO_DIALOG_TITLE
WinWaitClose MEDIA_INFO_DIALOG_TITLE
; if the user was originally in fullscreen this restore it nowif isFullScreen {
; restore fullscreen if it was orginally setWinGetPos , , &width, &height, vlcTitle
videoX := width/2
videoY := height/2CoordMode"Mouse", "Window"MouseMove videoX, videoY, 1Click2CoordMode"Mouse", "Screen"MouseMove orgMouseX, orgMouseY, 1
}
; move to the next video -- so it can delete/move this video (because vlc locks the running video)Send"{PgDn Down}"retry := 1whileWinGetTitle("A") == vlcTitle { ; wait for the next video to start playingSleep WAIT_FOR_NEXT_VID_SECS *1000 ; give it some more time to move to next videoretry++ifretry == WAIT_FOR_NEXT_VID_RETRIES { ; something went wrong. no more videos? (we cant delete/move if its only 1 video)MsgBox"Didn't detect next video change. Only 1 video left?`nCan't delete/move this video."Return
}
}
vlcTitle := WinGetTitle("A")
; perform action (delete/move the video now)BlockInput"MouseMoveOff" ; allow the user to have control over the mouse now (in case the delete/move takes too long)tryif action == "del_perm"FileDelete A_Clipboard
else if action == "del_recycle" {
;WinActivate "ahk_class Shell_TrayWnd" ;WinWaitActive "ahk_class Shell_TrayWnd"FileRecycle A_Clipboard
} elseFileMove A_Clipboard, action
catch as err
MsgBox"Problem deleting/moving file:`n`n" A_Clipboard "`n`n(" err.What " - " err.Message ")"
A_Clipboard := orgClipboardContent
tryWinActivate vlcTitle
catchWinActivate"ahk_class Qt5QWindowIcon" ; strange, we can't find the player! ok just activate any vlc window blindly
}
DoPermDelete() {
DoAction("del_perm")
}
DoRecycleDelete() {
DoAction("del_recycle")
}
DoMove(path) {
DoAction(path)
}
AllowMouse() {
BlockInput"MouseMoveOff"
}
The text was updated successfully, but these errors were encountered:
amiga-500
changed the title
Autohotkey v2 Script to ALLOW pressing "DEL" key to delete Videos
Here You Go - Alternate Script (Autohotkey v2) -- Press "DEL" key to delete Videos
Mar 21, 2024
amiga-500
changed the title
Here You Go - Alternate Script (Autohotkey v2) -- Press "DEL" key to delete Videos
Here You Go - Alternate Script (Autohotkey v2) -- Press DEL (or SHIFT+DEL) to delete Videos
Mar 21, 2024
amiga-500
changed the title
Here You Go - Alternate Script (Autohotkey v2) -- Press DEL (or SHIFT+DEL) to delete Videos
Here You Go - Alternate Script (Autohotkey v2+) -- Press DEL (or SHIFT+DEL) to Delete Videos + Move
Mar 22, 2024
Awesome script but whenever I try and delete a file when I have a bunch of videos in my playlist, I get a error "Didn't detect next video change. Only 1 video left? Can't delete/move this video."
Anyway around this since I do have other videos in the playlist.
Here is a a relatively better script than vlc-delete that I wrote using AutoHotkey (v2+) that not only works when VLC is in true full-screen mode, unlike vlc-delete, but this script also allows using multiple customizable hotkeys to do the following:
That script also looks interesting, but works independently from VLC plugins and needs AutoHotkey.
Here is a a relatively better script than vlc-delete that I wrote using AutoHotkey (v2+) that not only works when VLC is in true full-screen mode, unlike vlc-delete, but this script also allows using multiple customizable hotkeys to do the following:
I added a lot of code comments for your convenience. And, the default shortcut keys can be changed easily to whatever you want, as seen in the code below.
The text was updated successfully, but these errors were encountered: