2017-02-20 1 views
0

Windows OS에서 두 파일 탐색기간에 끌어서 놓기를 자동화하려고합니다. 브라우저에 대한 드래그 앤 드롭 구현에 대한 온라인 도움말을 찾을 수있었습니다. 하지만 다른 파일 탐색기로 파일을 끌어다 놓을 때 도움이되지 않습니다.자동화를 구현하는 방법 Windows에서 두 파일 탐색기간에 끌어서 놓기

+0

이 Autoit' http://stackoverflow.com/questions/41035353/how-to-handle-windows-authentication-'에 내 대답을 참조하십시오 : 다음과 같은 기능을 사용할 수있는 탐색기에서 선택을 얻으려면 popup-in-robot-framework-ride/41035644 # 41035644 – Goralight

+0

@Goralight autoit을 사용하면 드래그 앤 드롭을 구현할 수 없습니다. 그리고 당신의 솔루션은 브라우저에서 왔습니다. 파일 탐색기에서 수행 할 수있는 작업은 무엇입니까? –

+0

'마우스 다운 ','마우스 이동'및'마우스 다운'을 보셨습니까? 그러나 어느 쪽이든, 이것은 브라우저/웹용으로 만들어졌습니다. 그러나 이것이 파일 탐색기를 파일 브라우저로 보지 못하게 할 것이라고 생각하지는 않습니다. AutoIt이 데스크탑과 대화하는 것처럼 ... 당신은 아무것도 시도하지 않았습니까? – Goralight

답변

0

이 경우 Shell.Application 개체를 사용하십시오.

;=============================================================================== 
; Function Name....: _ActiveExplorer_GetSelected 
; Description......: Creates an array with 
;     - Count of selected files/folder 
;     - Path of active Explorer window and 
;     - the path/es of selected file/s /folder 
; Requirement(s)...: Opened Explorer window 
; Return Value(s)..: Array with data, $a[0] = Count, $a[1] = Folderpath, $a[2..] = File/Foldername 
; .................: ATTENTION! Last index $a[0]+1 !! 
; Author(s)........: BugFix ([email protected]) 
;=============================================================================== 
Func _ActiveExplorer_GetSelected() 
    Local $oShell = ObjCreate("Shell.Application") 
    Local $oExplorer, $sPath, $oFolderView, $iCount = 0, $sSelectedFiles = '', $n = 2 
    Local $oShellWindows = $oShell.Windows 
    For $i = 0 To $oShellWindows.Count -1 
     $oExplorer = $oShellWindows($i) 
     $sPath = StringReplace(StringReplace(StringTrimLeft($oExplorer.LocationURL, 8), '%20', ' '), '/', '\') 
     If WinGetTitle('[ACTIVE]') = $sPath Then ExitLoop 
    Next 
    $oFolderView = $oExplorer.Document.SelectedItems() 
    $iCount = $oFolderView.Count 
    Local $aOut[$iCount +2] 
    $aOut[0] = $iCount 
    $aOut[1] = $sPath 
    If $iCount = 0 Then 
     Return '' 
    Else 
     For $oFolderItem In $oFolderView 
      $aOut[$n] = $oFolderItem.Name 
      $n += 1 
     Next 
     Return $aOut 
    EndIf 
EndFunc ; ==>_ActiveExplorer_GetSelected 
+0

좋습니다. @McBarby는 고맙습니다. 그리고 너에게 알린다. –