Zuhair Posted May 2, 2020 Posted May 2, 2020 I am trying a script to save a project file from a software (MS Volt) by pressing a hot key but it is not working. Plz help. Pressing the hot key open the << Save project window >> as in common software asking for the file name that I want to save. I want to paste a predefined variable in this file name box and then save it but it does not paste the variable. The variable is defined at the start of the script as $vtp = 'Light24.vtp' for use in several functions in the script. WinWaitActive ('[CLASS:#32770]') ControlSend ('', '', '[CLASS:Edit1]', $vtp) ControlSend ('', '', '', '{ENTER}') something wrong?
careca Posted May 2, 2020 Posted May 2, 2020 (edited) The controlsend doesn't have any reference to the window you're working with, wouldn't that be advisable? Maybe like this? WinWaitActive ('[CLASS:#32770]') ControlSend ('[CLASS:#32770]', '', '[CLASS:Edit1]', $vtp) ControlSend ('[CLASS:#32770]', '', '', '{ENTER}') Edited May 2, 2020 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Zuhair Posted May 2, 2020 Author Posted May 2, 2020 Thank you careca. still it does not work. it types only n in the file name box as it was before
careca Posted May 2, 2020 Posted May 2, 2020 Is it possible that the variable is being overridden in another part of the script? Can you post a reproducible script we can test? Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Zuhair Posted May 2, 2020 Author Posted May 2, 2020 I even tried ControlSetText. Instead of variable I also used the actual string WinWaitActive('[CLASS:#32770]') ControlSend('[CLASS:#32770]', '', '[CLASS:Edit1]', 'Light24.vtp') but still it types n in that file name field. To test the code, it will need software and all related files. If you are ready I will send it.
careca Posted May 2, 2020 Posted May 2, 2020 (edited) yeah, send it all. It's very weird that it does the same with a literal string. One other option would be to just send. Did you try the good old 'send'? Edited May 2, 2020 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Zuhair Posted May 2, 2020 Author Posted May 2, 2020 Dear careca, Thank you for your kind reply. At last I solved it after several hours by removing the [CLASS:Edit1] . Now it is working perfectly as given WinWaitActive ('[CLASS:#32770]') ControlSend ('', '', '', $vtp) ControlSend ('', '', '', '{ENTER}') Thanks
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