If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
trouble with script generated by AU3Recorder within SciTE4
I recently used SciTE4AutoIt3 to create a script for opening a program, performing a couple of tasks within the program via mouse clicks and file selection, and then closing the program. I used the AU3Recorder within SciTE to create the script. Although creation went well, I notice that sometimes, the wrong files are clicked on and opened. Why is this and how can I get the script to open the same files identically each time? Thanks, Ab |
Ads |
#2
|
|||
|
|||
trouble with script generated by AU3Recorder within SciTE4
On Tue, 28 Apr 2015 14:21:20 -0400, Ab wrote:
I recently used SciTE4AutoIt3 to create a script for opening a program, performing a couple of tasks within the program via mouse clicks and file selection, and then closing the program. I used the AU3Recorder within SciTE to create the script. Although creation went well, I notice that sometimes, the wrong files are clicked on and opened. Why is this and how can I get the script to open the same files identically each time? Post your script. Not having seen it, my guess is that the script is simply opening the Nth file without regard to its filename, so as files are added or removed the Nth file becomes different. In some cases, programs can be opened with command line arguments that tell them which file they should open, so that may be an option rather than trying to select the file from within the program. The answer probably depends on what, exactly, you're trying to do. -- Char Jackson |
#3
|
|||
|
|||
trouble with script generated by AU3Recorder within SciTE4
On 04/28/2015 02:46 PM, Char Jackson wrote:
On Tue, 28 Apr 2015 14:21:20 -0400, Ab wrote: I recently used SciTE4AutoIt3 to create a script for opening a program, performing a couple of tasks within the program via mouse clicks and file selection, and then closing the program. I used the AU3Recorder within SciTE to create the script. Although creation went well, I notice that sometimes, the wrong files are clicked on and opened. Why is this and how can I get the script to open the same files identically each time? Post your script. Not having seen it, my guess is that the script is simply opening the Nth file without regard to its filename, so as files are added or removed the Nth file becomes different. In some cases, programs can be opened with command line arguments that tell them which file they should open, so that may be an option rather than trying to select the file from within the program. The answer probably depends on what, exactly, you're trying to do. Ok, thanks, what I'm trying to do is automate the process to allow sharing a Win file or location (in this case, my Win desktop) with my Ubuntu VM. My host is Win Xp with Ubuntu guest. The process involves opening up the Virtualbox control program and then through a series of mouse clicks, allowing the file or location to be shared. Here is the script: #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',300) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '') If $aResult[1] '00000409' Then MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00000409-' & $aResult[1] & ')') EndIf EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() #endregion --- Internal functions Au3Recorder End --- Run('C:\Program Files\Oracle\VirtualBox\VirtualBox.exe') _WinWaitActivate("Oracle VM VirtualBox Manager","") MouseClick("left",359,625,1) _WinWaitActivate("Nov6_2014enhanced Clone - Settings","") MouseClick("left",619,110,1) _WinWaitActivate("Add Share","") MouseClick("left",278,51,1) MouseClick("left",202,79,1) _WinWaitActivate("Browse For Folder","Select a directory") MouseMove(407,130) MouseDown("left") MouseMove(403,105) MouseUp("left") MouseClick("left",60,98,1) MouseClick("left",291,291,1) _WinWaitActivate("Add Share","") MouseClick("left",171,213,1) _WinWaitActivate("Nov6_2014enhanced Clone - Settings","") MouseClick("left",447,451,1) _WinWaitActivate("Oracle VM VirtualBox Manager","") MouseMove(1138,21) MouseDown("left") MouseMove(1139,21) MouseUp("left") #endregion --- Au3Recorder generated code End --- |
#4
|
|||
|
|||
trouble with script generated by AU3Recorder within SciTE4
On Tue, 28 Apr 2015 15:19:09 -0400, Ab wrote:
On 04/28/2015 02:46 PM, Char Jackson wrote: On Tue, 28 Apr 2015 14:21:20 -0400, Ab wrote: I recently used SciTE4AutoIt3 to create a script for opening a program, performing a couple of tasks within the program via mouse clicks and file selection, and then closing the program. I used the AU3Recorder within SciTE to create the script. Although creation went well, I notice that sometimes, the wrong files are clicked on and opened. Why is this and how can I get the script to open the same files identically each time? Post your script. Not having seen it, my guess is that the script is simply opening the Nth file without regard to its filename, so as files are added or removed the Nth file becomes different. In some cases, programs can be opened with command line arguments that tell them which file they should open, so that may be an option rather than trying to select the file from within the program. The answer probably depends on what, exactly, you're trying to do. Ok, thanks, what I'm trying to do is automate the process to allow sharing a Win file or location (in this case, my Win desktop) with my Ubuntu VM. My host is Win Xp with Ubuntu guest. The process involves opening up the Virtualbox control program and then through a series of mouse clicks, allowing the file or location to be shared. Here is the script: #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',300) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '') If $aResult[1] '00000409' Then MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00000409-' & $aResult[1] & ')') EndIf EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() #endregion --- Internal functions Au3Recorder End --- Run('C:\Program Files\Oracle\VirtualBox\VirtualBox.exe') _WinWaitActivate("Oracle VM VirtualBox Manager","") MouseClick("left",359,625,1) _WinWaitActivate("Nov6_2014enhanced Clone - Settings","") MouseClick("left",619,110,1) _WinWaitActivate("Add Share","") MouseClick("left",278,51,1) MouseClick("left",202,79,1) _WinWaitActivate("Browse For Folder","Select a directory") MouseMove(407,130) MouseDown("left") MouseMove(403,105) MouseUp("left") MouseClick("left",60,98,1) MouseClick("left",291,291,1) _WinWaitActivate("Add Share","") MouseClick("left",171,213,1) _WinWaitActivate("Nov6_2014enhanced Clone - Settings","") MouseClick("left",447,451,1) _WinWaitActivate("Oracle VM VirtualBox Manager","") MouseMove(1138,21) MouseDown("left") MouseMove(1139,21) MouseUp("left") #endregion --- Au3Recorder generated code End --- I haven't used Virtualbox, Au3Recorder, or SciTE4, but just looking at the script it seems to me that the primary issue is that the mouse is being moved to specific coordinates and being clicked, but it has no awareness of what it's clicking on. My thought is don't try to do this with a mouse macro because surely there's a better way, but I'll have to defer to the specialists here. Let's see what others have to say. BTW, how did you end up here, in a Win 7 group? -- Char Jackson |
#5
|
|||
|
|||
trouble with script generated by AU3Recorder within SciTE4
On 04/28/2015 04:12 PM, Char Jackson wrote:
On Tue, 28 Apr 2015 15:19:09 -0400, Ab wrote: On 04/28/2015 02:46 PM, Char Jackson wrote: On Tue, 28 Apr 2015 14:21:20 -0400, Ab wrote: I recently used SciTE4AutoIt3 to create a script for opening a program, performing a couple of tasks within the program via mouse clicks and file selection, and then closing the program. I used the AU3Recorder within SciTE to create the script. Although creation went well, I notice that sometimes, the wrong files are clicked on and opened. Why is this and how can I get the script to open the same files identically each time? Post your script. Not having seen it, my guess is that the script is simply opening the Nth file without regard to its filename, so as files are added or removed the Nth file becomes different. In some cases, programs can be opened with command line arguments that tell them which file they should open, so that may be an option rather than trying to select the file from within the program. The answer probably depends on what, exactly, you're trying to do. Ok, thanks, what I'm trying to do is automate the process to allow sharing a Win file or location (in this case, my Win desktop) with my Ubuntu VM. My host is Win Xp with Ubuntu guest. The process involves opening up the Virtualbox control program and then through a series of mouse clicks, allowing the file or location to be shared. Here is the script: #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',300) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '') If $aResult[1] '00000409' Then MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00000409-' & $aResult[1] & ')') EndIf EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() #endregion --- Internal functions Au3Recorder End --- Run('C:\Program Files\Oracle\VirtualBox\VirtualBox.exe') _WinWaitActivate("Oracle VM VirtualBox Manager","") MouseClick("left",359,625,1) _WinWaitActivate("Nov6_2014enhanced Clone - Settings","") MouseClick("left",619,110,1) _WinWaitActivate("Add Share","") MouseClick("left",278,51,1) MouseClick("left",202,79,1) _WinWaitActivate("Browse For Folder","Select a directory") MouseMove(407,130) MouseDown("left") MouseMove(403,105) MouseUp("left") MouseClick("left",60,98,1) MouseClick("left",291,291,1) _WinWaitActivate("Add Share","") MouseClick("left",171,213,1) _WinWaitActivate("Nov6_2014enhanced Clone - Settings","") MouseClick("left",447,451,1) _WinWaitActivate("Oracle VM VirtualBox Manager","") MouseMove(1138,21) MouseDown("left") MouseMove(1139,21) MouseUp("left") #endregion --- Au3Recorder generated code End --- I haven't used Virtualbox, Au3Recorder, or SciTE4, but just looking at the script it seems to me that the primary issue is that the mouse is being moved to specific coordinates and being clicked, but it has no awareness of what it's clicking on. My thought is don't try to do this with a mouse macro because surely there's a better way, but I'll have to defer to the specialists here. Let's see what others have to say. BTW, how did you end up here, in a Win 7 group? I'm brand new to scripts, so it was fun to create something automated like the above which pretty much works but with this minor inconsistent issue. I ended up here because I have visited before with nearly OT subjects, but find quite a few knowledgeable folks here. And I have used the group archives as a great reference too. |
#6
|
|||
|
|||
trouble with script generated by AU3Recorder within SciTE4
On 04/28/2015 04:21 PM, Ab wrote:
On 04/28/2015 04:12 PM, Char Jackson wrote: On Tue, 28 Apr 2015 15:19:09 -0400, Ab wrote: On 04/28/2015 02:46 PM, Char Jackson wrote: On Tue, 28 Apr 2015 14:21:20 -0400, Ab wrote: I recently used SciTE4AutoIt3 to create a script for opening a program, performing a couple of tasks within the program via mouse clicks and file selection, and then closing the program. I used the AU3Recorder within SciTE to create the script. Although creation went well, I notice that sometimes, the wrong files are clicked on and opened. Why is this and how can I get the script to open the same files identically each time? Post your script. Not having seen it, my guess is that the script is simply opening the Nth file without regard to its filename, so as files are added or removed the Nth file becomes different. In some cases, programs can be opened with command line arguments that tell them which file they should open, so that may be an option rather than trying to select the file from within the program. The answer probably depends on what, exactly, you're trying to do. Ok, thanks, what I'm trying to do is automate the process to allow sharing a Win file or location (in this case, my Win desktop) with my Ubuntu VM. My host is Win Xp with Ubuntu guest. The process involves opening up the Virtualbox control program and then through a series of mouse clicks, allowing the file or location to be shared. Here is the script: #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',300) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '') If $aResult[1] '00000409' Then MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00000409-' & $aResult[1] & ')') EndIf EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() #endregion --- Internal functions Au3Recorder End --- Run('C:\Program Files\Oracle\VirtualBox\VirtualBox.exe') _WinWaitActivate("Oracle VM VirtualBox Manager","") MouseClick("left",359,625,1) _WinWaitActivate("Nov6_2014enhanced Clone - Settings","") MouseClick("left",619,110,1) _WinWaitActivate("Add Share","") MouseClick("left",278,51,1) MouseClick("left",202,79,1) _WinWaitActivate("Browse For Folder","Select a directory") MouseMove(407,130) MouseDown("left") MouseMove(403,105) MouseUp("left") MouseClick("left",60,98,1) MouseClick("left",291,291,1) _WinWaitActivate("Add Share","") MouseClick("left",171,213,1) _WinWaitActivate("Nov6_2014enhanced Clone - Settings","") MouseClick("left",447,451,1) _WinWaitActivate("Oracle VM VirtualBox Manager","") MouseMove(1138,21) MouseDown("left") MouseMove(1139,21) MouseUp("left") #endregion --- Au3Recorder generated code End --- I haven't used Virtualbox, Au3Recorder, or SciTE4, but just looking at the script it seems to me that the primary issue is that the mouse is being moved to specific coordinates and being clicked, but it has no awareness of what it's clicking on. My thought is don't try to do this with a mouse macro because surely there's a better way, but I'll have to defer to the specialists here. Let's see what others have to say. BTW, how did you end up here, in a Win 7 group? I'm brand new to scripts, so it was fun to create something automated like the above which pretty much works but with this minor inconsistent issue. I ended up here because I have visited before with nearly OT subjects, but find quite a few knowledgeable folks here. And I have used the group archives as a great reference too. After using the script for a couple of days, I find that , for the most part, it seems to be working. Where I start having errors or hesitation is when another program is running at the same time the script is, seems to slow it down, make it so I have to complete it manually, etc. |
Thread Tools | |
Display Modes | Rate This Thread |
|
|