TormentoRobots Posted January 25, 2013 Posted January 25, 2013 (edited) it uses the global shortcut in winamp and copies to clipboard and pastes , thn copies the actual file to the Browse... button destinationthis uses clipboard clipboard contents will be cleared when using winamp copy.or passte file URI and press COPY for same SEND effectsetup global shortcut copy file path expandcollapse popup; TormentoRobots 2013 ;#NoTrayIcon #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Process.au3> Global $WAProcNm = "winamp.exe" Global $WAHotkey = "^!/" Global $sexy = "/" Global $ctrlalt = 1 Global $panicLVL = 0 Global $AppWindowTitle = "WA F*le C*py" Global $laladest, $Form1, $wHND, $Button1, $Button2, $Button3, $Input1, $Input2 #Region ### START Koda GUI section ### $Form1 = GUICreate($AppWindowTitle, 584, 128, 399, 508) $Button1 = GUICtrlCreateButton("WinampCopy", 120, 80, 88, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("Copy", 240, 80, 88, 25, $WS_GROUP) $Button3 = GUICtrlCreateButton("SET KEY", 6, 80, 72, 18, $WS_GROUP) $Input1 = GUICtrlCreateInput("", 8, 16, 561, 21) $Input2 = GUICtrlCreateInput("", 408, 80, 161, 21) $ButtonBROWSE = GUICtrlCreateButton("Browse...", 480, 48, 73, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ;EXIT Exit Case $Button1 ;Winamp Copy Button GUICtrlSetState($Button1, $GUI_DISABLE) GUICtrlSetState($Button2, $GUI_DISABLE) local $tempdest = guictrlread($Input2) if $tempdest = "" then Msgbox(0, $AppWindowTitle, "Config is incomplete. Please set your files' destination", 3) $panicLVL = $panicLVL + 1 endif If ProcessExists($WAProcNm) then Local $clipvar = SendWAK() GUICTRLSETDATA($Input1, $clipvar) Local $tempvar = $clipvar ProgressOn($AppWindowTitle, "copying", "0 percent") For $i = 10 to 100 step 10 sleep(33) if $i = 10 then if $panicLVL <= 0 then FileCopy($tempvar, $tempdest,0) endif endif ProgressSet( $i, $i & " percent") Next ProgressSet(100 , "Done", "Complete") sleep(500) ProgressOff() GUICtrlSetState($Button1, $GUI_ENABLE) GUICtrlSetState($Button2, $GUI_ENABLE) Else msgbox(0, $AppWindowTitle, $WAProcNm & " is not running",3) $panicLVL = $panicLVL + 1 EndIf $panicLVL = 0 GUICtrlSetState($Button1, $GUI_ENABLE) GUICtrlSetState($Button2, $GUI_ENABLE) Case $ButtonBROWSE ; Destination Browse Local $prevar = GuiCtrlRead($Input2) Local $Dvar = _BrowseForFolder($prevar) If $Dvar = "" then GUICtrlSetData($Input2, $prevar) Else GUICtrlSetData($Input2, $Dvar) EndIf Case $Button3 ;SET wa KEY local $Waky = SETWAKey() $WAHotkey = $Waky Case $Button2 ; Copy Button GUICtrlSetState($Button1, $GUI_DISABLE) GUICtrlSetState($Button2, $GUI_DISABLE) $tempdest = guictrlread($Input2) if $tempdest = "" then Msgbox(0, $AppWindowTitle, "Config is incomplete. Please set your files' destination", 3) $panicLVL = $panicLVL + 1 endif Local $tempvar = GUICTRLREAD($Input1) ProgressOn($AppWindowTitle, "copying", "0 percent") For $i = 10 to 100 step 10 sleep(60) if $i = 10 then if $panicLVL = 0 then FileCopy($tempvar, $tempdest,0) endif endif ProgressSet( $i, $i & " percent") Next ProgressSet(100 , "Done", "Complete") sleep(500) ProgressOff() GUICtrlSetState($Button1, $GUI_ENABLE) GUICtrlSetState($Button2, $GUI_ENABLE) EndSwitch WEnd ; FUNCTIONS func SETWAKey() Local $nEdit, $nOk, $nCancel, $xmsg $wHND = GUICreate("Global hotkey", 268, 176, 270, 319) $nOk = GUICtrlCreateButton("OK", 150, 134, 25, 25) $nCancel = GUICtrlCreateButton("Cancel", 180, 134, 50, 25) $nCombo1 = GUICtrlCreateCombo("", 102, 94, 40, 25) GUICtrlSetFont(-1, 10, 800, 0, "8x16") $Checkbox1 = GUICtrlCreateCheckbox("CTRL/ALT", 16, 94, 80, 25) $Label1 = GUICtrlCreateLabel("Add General: Copy File Path, enable Global Hotkeys", 8, 24, 250, 17) $Label2 = GUICtrlCreateLabel("Winamp", 11, 2, 60, 20) GUICtrlSetFont(-1, 10, 800, 4, "MS Sans Serif") $Label3 = GUICtrlCreateLabel("provide settings here:", 78, 45, 115, 17) $Group1 = GUICtrlCreateGroup("Winamp EXE name", 152, 56, 113, 65) $INP_WAexe = GUICtrlCreateInput("", 160, 80, 97, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) guictrlsetData($nCombo1, $sexy) guictrlsetData($INP_WAexe, $WAProcNm) dim $tempKEY = StringRight($WAHotkey, 1) for $i = 65 to 90 GUICtrlSetData($nCombo1, CHR($i)) next GUICtrlSetData($nCombo1, "/") GUICtrlSetData($nCombo1, ".") GUICtrlSetData($nCombo1, "]") GUICtrlSetData($nCombo1, "[") for $i = 48 to 57 GUICtrlSetData($nCombo1, CHR($i)) next GUISetState() if $ctrlalt = 1 then guictrlsetstate($Checkbox1, $GUI_CHECKED) While 1 $xmsg = GUIGetMsg() If $xmsg = $GUI_EVENT_CLOSE Then GUISetState(@SW_HIDE, $wHND) Return endif If $xmsg = $nCancel then GUISetState(@SW_HIDE, $wHND) Return endif if $xmsg = $nOk Then local $XKEY, $newkey, $WAtempexe $sexy = GUICtrlRead($nCombo1) local $WAtempexe = GUICtrlRead($INP_WAexe) $WAProcNm = $WAtempexe if GuiCtrlRead($Checkbox1) = 1 then $newkey = "^!" & $sexy $ctrlalt = 1 else $newkey = $sexy $ctrlalt = 0 endif GUISetState(@SW_HIDE, $wHND) Return $newKEY endif WEnd endfunc Func SendWAK() Send($WAHotkey) sleep(150) Local $clipvar = ClipGet() if StringIsASCII($clipvar) = 1 then if StringLEN($clipvar) <= 260 then Return $clipvar endif else $panicLVL = $panicLVL + 1 msgbox(0, $AppWindowTitle & "- wtf .. ?" , "Shitty characters not allowed",3) endif EndFunc Func _BrowseForFolder($fncdest = @homedrive) Local $ret = FileSelectFolder("Choose a folder", "", "", $fncdest) Return $ret EndFunc Edited January 26, 2013 by TormentoRobots #Include-once;TormentoRobots
TormentoRobots Posted January 25, 2013 Author Posted January 25, 2013 (edited) winamp settings: Edited January 26, 2013 by TormentoRobots #Include-once;TormentoRobots
PhoenixXL Posted January 26, 2013 Posted January 26, 2013 (edited) What is the purpose of the code there is no documentation anywhere, is it just as the title says a WINAMP.EXE copy program orelse do it have any other utility ? PLus : Your code consists of error, please rectify it before submitting ! Edited January 26, 2013 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
TormentoRobots Posted January 29, 2013 Author Posted January 29, 2013 errors never stopped me hehe. oh hey I fixed something maybe its ok now maybe not #Include-once;TormentoRobots
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now