dunk6 Posted October 5, 2009 Share Posted October 5, 2009 (edited) Hi, Using mouseCLick function, can i script something like this:From right click, select and open shortcut/action of the program in context menu.MouseClick("menu")thanks in advance Edited October 5, 2009 by dunk6 Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 5, 2009 Share Posted October 5, 2009 Hi, Using mouseCLick function, can i script something like this: From right click, select and open shortcut/action of the program in context menu.MouseClick("menu") thanks in advance Only if you know the X/Y coordinates of what you want to click on. More likely you could use hotkeys already built in, like: ; Send 'o' for open file Send("o") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
dunk6 Posted October 6, 2009 Author Share Posted October 6, 2009 Only if you know the X/Y coordinates of what you want to click on. More likely you could use hotkeys already built in, like: ; Send 'o' for open file Send("o") That's the problem,I dont knw wthr it have hotkeys built in. But I try to code like this, and it run the way i want, but is there simplest way to do??: ;on right click MouseClick("right") $count = 1 Do Send("{DOWN}") $count = $count + 1 Until $count > 7 Send("{ENTER}") thanks Link to comment Share on other sites More sharing options...
herewasplato Posted October 6, 2009 Share Posted October 6, 2009 ;on right click MouseClick("right") Send("{DOWN 8}") Send("{ENTER}")Context menus usually change depending on what you click on. I know that you said in another post that the software that you are wanting to automate is on the context menu when you "right click on all kind of files and folders". But if some other software adds items to the context menu only when files are "right clicked on" , then the menu item that you are interested in could be moved down to 10. (I'm not sure that I was very clear there - so if you don't understand all of that, just ignore it.)Using a key is better:(Assumes XP as the OS)Right click on an empty spot on your desktopSelect PropertiesSelect the tab named "Appearance"Click on the button labeled "Effects..."If need be - uncheck the option to:"Hide underlined letters for keyboard navigation until I press the Alt key""OK" your way out of those two windows.Now right click on a file and see if there is a letter that is underlined on the menu item of interest.If yes, then replaceSend("{DOWN 8}")withSend("e") ; <<< use the letter of interest.If that works for you - then you do not need:Send("{ENTER}") [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
dunk6 Posted October 7, 2009 Author Share Posted October 7, 2009 Context menus usually change depending on what you click on. I know that you said in another post that the software that you are wanting to automate is on the context menu when you "right click on all kind of files and folders". But if some other software adds items to the context menu only when files are "right clicked on" , then the menu item that you are interested in could be moved down to 10. (I'm not sure that I was very clear there - so if you don't understand all of that, just ignore it.)Using a key is better:...Now right click on a file and see if there is a letter that is underlined on the menu item of interest.If yes, then replaceSend("{DOWN 8}")withSend("e") ; <<< use the letter of interest.If that works for you - then you do not need:Send("{ENTER}") Unfortunately, no key are applied for that programand yes, i understand bout ur concern on the context menu things, but i only see that is the only solution i have for now! Link to comment Share on other sites More sharing options...
dunk6 Posted October 9, 2009 Author Share Posted October 9, 2009 (edited) I found this method in VBA,InvokeVerbEx("name") which will select from the context menu. It open my program window, doing the prog execution, but if during it running, i cannot move away from it windows or the execution did not work. someone tell me how to fix this, thanks!! $objShell = ObjCreate("Shell.Application") $objFolder = $objShell.Namespace($source) $colItems = $objFolder.Items For $i = 0 to $colItems.Count - 1 ;doing right click here $colItems.Item($i).InvokeVerbEx("Encrypt") Sleep(500) ;send password ControlSend("SafeNet ProtectPack", "", "Edit2", $pass) Sleep(500) ;confirm password ControlSend("SafeNet ProtectPack", "", "Edit3", $pass) Sleep(500) ;execute program Send("{ENTER}") Sleep(500) Send("{ENTER}") Next and sometimes doing problem like here: http://www.autoitscript.com/forum/index.php?showtopic=103325&view=findpost&p=734220 Edited October 9, 2009 by dunk6 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now