Jump to content

uTorrent - Sending shortcuts to open up dialogs


Recommended Posts

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
Link to comment
Share on other sites

Add this to top of script

Opt("WinTitleMatchMode", 2)

And remove "µ" from window title.

EDIT: and look again at your parameters of ControlSend.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
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
 Share

×
×
  • Create New...