I’m confsued.
I’m running this code …
if WaitAndClick("CSUserUserName-End" ) then
Set EndMouse to MouseLocation()
if WaitAndClick( "CSUserUserName" ) then
Set StartMouse to MouseLocation()
typetext UserToAdd.UID2
Click StartMouse
mouseButtonDown( 1)
MoveTo (EndMouse)
MouseButtonUp( 1)
TypeText "\cC\C"
Set UserToAdd.UID2 = RemoteClipboard()
log UserToAdd.UID2
end if
end if
Function WaitAndClick
params ImageName
Set Ret = false
if ImageFound( 8, ImageName ) then
click FoundImageLocation()
set Ret = true
end if
return Ret
end WaitAndClick
But here’s what the log says for that code …
Thu, 17/07/08 1:41:15 PM imagefound CSUserUserName-End found at (656, 256)
Thu, 17/07/08 1:41:15 PM click at (656, 256)
Thu, 17/07/08 1:41:27 PM imagefound CSUserUserName found at (433, 267)
Thu, 17/07/08 1:41:27 PM click at (433, 267)
Thu, 17/07/08 1:41:32 PM typetext whitee362
Thu, 17/07/08 1:41:34 PM click at (433, 267)
Thu, 17/07/08 1:41:37 PM mousebuttondown Button:1
Thu, 17/07/08 1:41:39 PM moveto at (656, 256)
Thu, 17/07/08 1:41:40 PM mousebuttonup Button:1
Thu, 17/07/08 1:41:48 PM typetext \cC\C
Thu, 17/07/08 1:41:53 PM log typetext UserToAdd.UID2
In the last line of the log, I am seeing … basically the stale content of the local clipboard, rather than what I believe should be in the clipboard. In this case, it looks like some code that I cut and pasted within my script editor window, prior to starting to run the script in question.
Here’s another set of results, this time I manually grabbed the contents of the field in question and stuffed it into the clipboard before resetting everything and starting the process afresh. Note that at the end of the process, although the typed text was “whitee363”, the remoteclipboard) call returned the stale value of “whitee362”
put remoteclipboard()
whitee362
Thu, 17/07/08 2:00:18 PM imagefound CSUserUserName-End found at (656, 256)
Thu, 17/07/08 2:00:19 PM click at (656, 256)
Thu, 17/07/08 2:00:25 PM imagefound CSUserUserName found at (433, 267)
Thu, 17/07/08 2:00:26 PM click at (433, 267)
Thu, 17/07/08 2:00:28 PM typetext whitee363
Thu, 17/07/08 2:00:30 PM click at (433, 267)
Thu, 17/07/08 2:00:44 PM mousebuttondown Button:1
Thu, 17/07/08 2:00:45 PM moveto at (656, 256)
Thu, 17/07/08 2:00:52 PM mousebuttonup Button:1
Thu, 17/07/08 2:00:53 PM typetext \cC\C
Thu, 17/07/08 2:01:00 PM log whitee362
Regardless, the MouseDown/MouseUp sequence correctly highlights the text I wish to copy, but the TypeText “\cC\C” does not seem to push that text into the clipboard.
What am I missing here, please?