Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/17/2017 in all areas

  1. Inververs

    API Command (Google)

    @Deye download this udf https://github.com/inververs/googletoken This is example with OAuth 2.0 client ID. But it is better for you to make a service account I have no google drive. Therefore, I can not say what the result will be. Set your own json file and file id #include '_googletoken.au3' $client_json_file = 'client_secret_878378520961-hehpvlick1fkk1f24f1kbhqnl4vep6so.apps.googleusercontent.com.json' _googleapis_setupDesktopOAuth2FromFile($client_json_file) _googleapis_setScope('https://www.googleapis.com/auth/drive') $sAccessToken = _googleapis_getToken() MsgBox(0, 'Token', $sAccessToken) If Not $sAccessToken Then Exit $sFileId = 'enter here fileid' $sURL = 'https://www.googleapis.com/drive/v2/files/' & $sFileId & '/touch' $sHead = 'Authorization=' & 'Bearer ' & $sAccessToken $sResponse = __googleapis_request('POST', $sURL, '', $sHead) MsgBox(0, 'Response', $sResponse)
    2 points
  2. Inververs

    API Command (Google)

    lol, brevity is the soul of wit. Forgive me, dude, but your answers do not help me. Understand yourself. What's error 1? In what place, I wrote you an MSGbox, it's heading ... and you're just sending me error number 1, are you serious?
    1 point
  3. Have you tried comparing to FFau3.WCD.activeElement instead of document.activeElement ?
    1 point
  4. You're welcome. (De nada ) About question to LarsJ. I know He can answer better than me But I want to write a bit. ObjCreateInterface It's not experimental. We have been using it since years without any bug. To learn about interfaces and objects You need to know about COM/Interface Implementation, check msdn doc. Then You can search over the forum We have a lot of examples using ObjCreateInterface. About Focus and Position. Sure It's possible. I can't check right now but sure LarsJ will provide a solution. Of course you can try by yourself probably reading the whole LarsJ 's topic about Automation Windows Explorer You'll find the answer or a correct way to go to. Saludos
    1 point
  5. Danyfirex - The ClassNN changes each time the .exe is ran, just like the ID. I'll try TheDcoder's suggestion, but I'm starting to feel this is a lost cause.
    1 point
  6. Interesting solution. I usually use UI Automation code.
    1 point
  7. Hello. Try to add all the references. I did this PoC without using extern UDF. Tested in Windows 10 (Spanish Lang) #RequireAdmin ; Runs script as admin user #include <AutoItConstants.au3> Local $sTextDesktop="Escritorio" ;Use "Desktop" for English OS Local $sTextDocuments="Documentos" ;Use "Documents" for English OS ;just for closing the windows if they exist WinClose("[CLASS:CabinetWClass]", $sTextDesktop) WinClose("[CLASS:CabinetWClass]",$sTextDocuments) Local $sFile = @UserProfileDir & "\Desktop\testautoit.txt" FileWrite($sFile,"My Demo File") Local $filePath1 = @UserProfileDir & "\Desktop" Local $filePath2 = @UserProfileDir & "\Documents" Local $iPid1 = Run("explorer.exe " & $filePath1) Local $hHandle1 = WinWait("[CLASS:CabinetWClass]", $sTextDesktop) Local $iPid2 = Run("explorer.exe " & $filePath2) Local $hHandle2 = WinWait("[CLASS:CabinetWClass]", $sTextDocuments) ConsoleWrite("Handle1: " & $hHandle1 & @TAB & "Title: " & WinGetTitle($hHandle1) & @CRLF) ConsoleWrite("Handle2: " & $hHandle2 & @TAB & "Title: " & WinGetTitle($hHandle2) & @CRLF) Local $iWidth = @DesktopWidth / 2 Local $iHeight = @DesktopHeight - 50 ConsoleWrite($iWidth & @CRLF) ConsoleWrite($iHeight & @CRLF) WinMove($hHandle1, "", 1, 1, $iWidth, $iHeight) ;move window 1 WinMove($hHandle2, "", $iWidth, 1, $iWidth, $iHeight) ;move window 2 Sleep(500) WinActivate($hHandle1, "") Local $oShell = ObjCreate("Shell.Application") Local $oDocument = 0 For $oWindow In $oShell.Windows If $hHandle1 = $oWindow.HWND Then ConsoleWrite(Hex($oWindow.HWND) & @CRLF) $oDocument = $oWindow.Document EndIf Next If IsObj($oDocument) Then Local $bFound = False Local $iCountIndex = 0 Local $oItems = $oDocument.Folder.Items For $oItem In $oItems If $iCountIndex = 0 Then $oDocument.SelectItem($oItem, 1) ;select First Item If $oItem.Path = $sFile Then ConsoleWrite($oItem.Path & @CRLF) $bFound = True ExitLoop EndIf $iCountIndex += 1 Next If $bFound Then ConsoleWrite($iCountIndex & @CRLF) ControlSend($hHandle1, "", "", "{DOWN " & $iCountIndex & "}") Local $aPixel = PixelSearch(0, 0, $iWidth, $iHeight, 0xCCE8FF) If IsArray($aPixel) Then ;~ MouseMove($aPixel[0] + 10, $aPixel[1] + 10) ;~ MouseMove($iWidth + ($iWidth / 2), 10) MouseClickDrag($MOUSE_CLICK_LEFT, $aPixel[0] + 10, $aPixel[1] + 10, $iWidth + ($iWidth / 2), 10) EndIf Else MsgBox(0,"Information","File Not Found") EndIf EndIf Exit Saludos
    1 point
×
×
  • Create New...