What would cause MouseClickDrag to not work and is there a way to improve its function?
I'm using Camtasia video editing software and I've got a number of steps which are repetitive, hence my use of an AutoHotkey script.
In one part of the process, I remove a small section of the recording. Doing so leaves a gap between the previous part of the recording (to the left) and the remaining part of the recording (to the right). When going through the process manually, the gap can easily be closed by simply dragging the remaining part of the recording from right to left.
I've used MouseClickDrag plenty of times in the past, but with this script, everything works great until the drag step and that doesn't work at all. (I can see the cursor move from the starting position to the ending position but it doesn't drag the recording bar with it as it should.)
Here is the portion of the script which includes the MouseClickDrag step:
Code: Select all
. . .
;Sleep lengths:
short := 399
medium := 999
long := 2299
CoordMode, Mouse, Screen
MouseGetPos px,py
MouseMove %px%, 1945
Sleep, short
Click ; activate track
Sleep, short
Click, 335, 1735 ; split track at current position
Sleep, short
Click, 400, 1945 ; activate segment to be deleted
Sleep, short
Send {Delete} ; delete segment
Sleep, short
MouseMove %px%, 1945
Sleep, short
MouseMove, 100, 0,, R
Sleep, short
Click
Sleep, short
xNew := px + 100
Sleep, medium
MouseClickDrag, Left, %xNew%, 1945, 350, 1945
Sleep, medium
MouseMove %xNew%, 1945
Sleep, short
Click
Sleep, short
. . .
MouseClickDrag, WhichButton, X1, Y1, X2, Y2 [, Speed, Relative]
I've tried adding a value for that parameter but I've never (in this script or others in the past) seen any resulting change in the cursor speed.
Any suggestions re how to get the drag step working would be appreciated.
Thanks