Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance force
- #NoEnv
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- #Persistent
- #^y::
- Gui, New, , YT URL Shortener
- Gui, Add, Text, x4 y7, URL:
- Gui, Add, Edit, x32 y5 w400 h18 vURL
- Gui, Add, Button, x435 y4 h20 Default gShort, GO!
- Gui -Resize -SysMenu +ToolWindow +AlwaysOnTop
- Gui, Show, w470
- Return
- Short:
- Gui, Submit
- Gui, Hide
- Name := URL
- If FoundPos := InStr(Name, "https://www.youtube.com/") {
- Name := strReplace(Name,"www.youtube.com","youtu.be")
- Name := strReplace(Name,"/watch?v=", "/")
- }
- Else If FoundPos := InStr(Name, "https://www.dropbox.com/") {
- Name := strReplace(Name,"www","dl")
- Name := strReplace(Name,"dropbox", "dropboxusercontent")
- Name := strReplace(Name,"?dl=0","")
- }
- Else {
- MsgBox Error
- }
- GuiControl, , URL, %Name%
- Gui, Show
- Return
- GuiClose:
- GuiEscape:
- Gui, Destroy
Add Comment
Please, Sign In to add comment