AutoHotkey Community

It is currently May 27th, 2012, 2:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: February 15th, 2010, 2:00 pm 
Offline

Joined: March 9th, 2009, 12:15 am
Posts: 28
I use this script in combination with Total commander and/or Winrar.

If you have more files to extract with the same password, this script will automatically enter the last password - there is a timeout and a basic "wrong pwd" detection.


Code:
;                      http://monschein.org
;
#SingleInstance
#NoEnv
#Persistent

timeoutval := 120         ;forget password after x sec.

Menu, tray, add
Menu, tray, add, Change password, Submenu
Gui,Add,Text,w300,Enter password
Gui,Add,Edit,w300 r1 vMyEdit
Gui, Add, Button, Default, OK
Gui, Show
Gui, Hide
SetTimer,Check,500
timeoutval := timeoutval * -1000

return

Submenu:
Gui, Show
return

ButtonOK:
Gui, Submit
SetTimer,Check,500
return

Clear:
timeout := true
return

Check:
IfWinActive, Enter password               ;winrar pwd window title
{
   if (MyEdit = "" || timeout) {
;      GuiControl,,MyEdit,%Clipboard%   
      SetTimer, Check, Off
      Sleep,200
      Gui, Show
      timeout := false
      return
   }
   else
   {
      timeout := false
      SendInput {Raw}%MyEdit%
      SendInput {Enter}
      SetTimer,Clear,%timeoutval%
   }
   return
}

IfWinActive, Password required!               ;total commander pwd window title
{
   if (MyEdit = "" || timeout) {
;      GuiControl,,MyEdit,%Clipboard%   
      SetTimer, Check, Off
      Sleep,200
      Gui, Show
      timeout := false
      return
   }
   else
   {
      timeout := false
      SendInput {Raw}%MyEdit%
      SendInput {Enter}
      SetTimer,Clear,%timeoutval%
   }
   return
}

IfWinActive, Please purchase WinRAR license         ;get rid of the shareware dialog
{
   SendInput {Tab 2}{Enter}
   return

}

IfWinActive, ahk_class #32770, Disk read         ;total commander wrong pwd
{
   MyEdit := ""
   return
}

IfWinActive, ahk_class #32770, Error in      ;total commander wrong pwd
{
   MyEdit := ""
   return
}

IfWinActive, WinRAR: Diagnostic messages         ;winrar wrong pwd
{
   MyEdit := ""
   return
}

_________________
http://monschein.org


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 24th, 2010, 11:08 pm 
Offline

Joined: July 24th, 2010, 11:04 pm
Posts: 1
After modification of the targeted TC pass title window to match my language, it works like a charm.
So many thanks for this generic "do not bug me with that damn pass" system. :)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group