Advertisement
Armandur

rewrite dropbox shared link to direct link

Jan 7th, 2016
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #persistent
  2.  
  3. OnClipBoardChange:
  4. ;Perform the RegEx find and replace operation,
  5. ;where "//dl" is the whole-word we want to replace.
  6.     haystack := Clipboard
  7.     if (InStr(haystack, "https://www.dropbox.com/s/"))
  8.     {
  9.         needle := "//www"
  10.         replacement := "//dl"
  11.         result := RegExReplace(haystack, needle, replacement)
  12.    
  13.         ;Empty the Clipboard
  14.             Clipboard =
  15.         ;Copy the result to the Clipboard.
  16.             Clipboard := result
  17.         ;Wait for the Clipboard to fill.
  18.             ClipWait
  19.     }
  20. ;Done!
  21.     return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement