Jump to content
FusionAura

uTorrent - Sending shortcuts to open up dialogs

Recommended Posts

FusionAura

Hi,

I am trying to programatically use Autoit to migrate uTorrent files. I need to send the key Ctrl + D to uTorrent, and then fill in a dialogue  box on the torrent location and the file location.

 

However, I am stuck after opening uTorrent and trying to send the Ctrl D Command.

This may not be the best but.

Run("C:\Users\User\AppData\Roaming\uTorrent\uTorrent.exe")
WinWaitActive("µTorrent 3.4.3  (build 40298) [32-bit]")
ControlSend("µTorrent 3.4.3  (build 40298) [32-bit]", "", "", Send("^d"))

 

That's the current code. I've tested this back with notepad to see if the code is working fine and it is, which make me struggle to understand why it wouldn't work for uTorrent. Could anybody help out please?

Edited by FusionAura

Share this post


Link to post
Share on other sites
FusionAura

Hi,

uTorrent is actually written in C++, but yes, I've tried the basic Send with the WinWaitActive as per the basic example for notepad and it didn't work either :(

Share this post


Link to post
Share on other sites
FusionAura

I JUST SOLVED IT. Haha, Thanks for your solution tho, tried it out as well to be working :)

 

I did it a different way tho, got the PID and used WinGetProcess to get the actual full title itself, my guess is the title of the program has some special characters thus the problem.

I have another problem tho....When automating the dialog box itself, the title of the dialog box is "Choose where to download 12345 torrent", because 12345 torrent is a variable, i decided to match it to Choose where to download.

 

Following your trend above, i did.

   Opt("WinTitleMatchMode", 2)
   ControlSend("Choose where to download", "", "[CLASSNN:Edit]", "C:\Users\Info\Desktop\12345")

 

But it doesn't seem to match it :(

 

Any idea how?

 

Edit, Fixed it :) 

 

Thanks!

 

Edited by FusionAura

Share this post


Link to post
Share on other sites
argumentum

did you know that you can run a program from within uTorrent ?

You can use the following parameters:

%F - Name of downloaded file (for single file torrents)
%D - Directory where files are saved
%N - Title of torrent
%P - Previous state of torrent
%L - Label
%T - Tracker
%M - Status message string (same as status column)
%I - hex encoded info-hash
%S - State of torrent
%K - kind of torrent (single|multi)

Where State is one of:

Error - 1
Checked - 2
Paused - 3
Super seeding - 4
Seeding - 5
Downloading - 6
Super seed [F] - 7
Seeding [F] - 8
Downloading [F] - 9
Queued seed - 10
Finished - 11
Queued - 12
Stopped - 13
Queued - 12
Preallocating - 17
Downloading Metadata - 18
Connecting to Peers - 19
Moving - 20
Flushing - 21
Need DHT - 22
Finding Peers - 23
Resolving - 24
Writing - 25

 

Share this post


Link to post
Share on other sites
FusionAura

Yes I did, but that doesn't work with what I'm trying to do. I'm adding a torrent, not running a program after the torrent is completed :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • greichert
      By greichert
      I am running the following code:
      DirRemove("C:\Desktop\Install.zip",1) I don't receive an error but the folder is not deleted. If i run this same script on a non zipped folder it works fine. Does DirRemove not work for zipped files? If not is there a way to delete them?
    • Haselnuzz
      By Haselnuzz
      Hi and Hello from a Noob..:-)
      i have a very weird problem. I fill up a 2d array with a)numbers and b)letters from A-Z, so 2 columns. This works absolutely perfect. But as soon as i try to sort them (numbers ascending) the array ends up in some kind of "String-sortation". What exactly am i doin wrong? To make it easy, i post below the piece of code, which i am talking about. Hope that someone can help me out.
      Func Analyse()
          Local $BasisArray[0]
          Local $aFill = "A" & "|B" & "|C" & "|D" & "|E" & "|F" & "|G" & "|H" & "|I" & "|J" & "|K" & "|L" & "|M" & "|N" & "|O" & "|P" & "|Q" & "|R" & "|S" & "|T" & "|U" & "|V" & "|W" & "|X" & "|Y" & "|Z"
          _ArrayAdd ($BasisArray, $afill)
          Local $FreqArray[0][2]=[[]]
       
          $row = 0

          For $i = 0 to 25
       
              $fummel = _ArrayToString ($BasisArray, ":" , $row, $row)
              $readout = _GUICtrlRichEdit_GetText ($hRichEdit)
              $anzAs = stringreplace ($readout, $fummel, $fummel)
              $extended = @extended
              $FreqFill = $extended & "|" & $fummel
              _ArrayAdd($FreqArray, $FreqFill)
       
              $row = $row + 1
          Next
          _ArrayDisplay($FreqArray, "2D - Item delimited")
          _ArraySort($FreqArray)
          _ArrayDisplay($FreqArray, "bla")
       
       
      Thanks for helping me,
       
      Cheers,
       
      Patrick
    • greichert
      By greichert
      I am running an exe, that copies a seperate exe (test123.exe)from my computer and puts it onto a remote server "testserver". Everything  works fine up to this point. I need to run this copied exe (test123.exe) on "testserver" but it keeps running on my computer instead. The code I am using to run the exe is below. What am I doing wrong? How can I get this executable to run on the remote server and not my home computer?
      RunWait( "\\testserver.domain.com\c$\user1\greichert\Desktop\InstallEXE\InstallEXE\test123.exe","\\testserver.domain.com\c$\Users\user1\Desktop\InstallEXE\InstallEXE");run exe  
    • greichert
      By greichert
      I am trying to stop a windows service on a separate server than where my script is running. When I run the following script on the same server as the service I need to stop, it works fine. 
      RunWait(@ComSpec & " /c net stop FascetAgentfv2", @ScriptDir, @SW_HIDE);stop agent But when I change "@ScriptDir" to ""\\newserver\c$\Program Files\test\" and run it on my server nothing happens. I tried to error handle and all it was returning was "2". Any suggestions?
    • faustf
      By faustf
      hi guys
      i have a script  like this,  in windows 7 work perfect , in windows 10 not  work  , some one can explain me  why ??'
      #include <Array.au3> #include <MsgBoxConstants.au3> Global $aGPathFoto= FileReadToArray (@ScriptDir & "\TEMP\PathFoto.txt") Local $ctrl = 0 While 1 Local $hWnd = WinWait("[CLASS:#32770]", "", 10) If WinExists("[CLASS:#32770]") Then If $ctrl < 2 Then ControlSend($hWnd, "Choose File to Upload", "[CLASS:Edit; INSTANCE:1]", $aGPathFoto[0]&"{Enter}") Exit $ctrl += 1 Else ExitLoop EndIf EndIf WEnd $aGpathfoto = C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg
×