Jump to content

trying some simple clicks not work? (noob)


Go to solution Solved by SadBunny,

Recommended Posts

 
MouseClick("left" 624, 375, 1,10) ;op app
sleep(2000)
MouseClick("left" [,680, 1113 [, click = 1 [speed = 10]]]) ;switch windows app
MouseClickDrag("left", 601, 960, 280, 960) ;close op app
MouseClick("left" [,576, 962 [, click = 1 [speed = 10]]]) ; root explorer
MouseClick("left" [,346, 196 [, click = 1 [speed = 10]]]) ; document main
 
 
when i run script get error:
line 2 
mouseclick("left"624,375,1,10)
mouselick"^ERROR
 
error:error in expression
 
im new to this try do a kinda like a marco, but will try to add more functions once i get some of the bassics down.. btw thats the sstart of the script not sure i need to start it some other way..
Link to comment
Share on other sites

  • Solution

You forgot the comma between "left" and 624.

Also in the rest of your code, the square brackets (meaning "[" and "]") in the helpfile indicate optional arguments. So a text like "Function _myFunction(arg1 [, arg2])" means that arg1 is necessary, and arg2 is optional.

So in the case of MouseClick, the helpfile states:

MouseClick ( "button" [, x, y [, clicks = 1 [, speed = 10]]] )

This means that you can do:

MouseClick("left")

or

MouseClick("left", 10, 20) (note: x and y are on the same "level of optional" so to speak, you can choose to either not supply both or supply both)

or

MouseClick("left", 10, 20, 2) ("clicks = 1" as an argument means that if you do not specify it, it defaults to 1, in this case we do set it to 2)

or

MouseClick("left", 10, 20, 2, 5) (again, "speed = 10" means "default to 10 if not given as argument".)

Hope this makes it somewhat more clear.

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

  • Moderators

pdark1987, what kind of document are you trying to manipulate? I can almost guarantee there is an easier way than using Mouseclicks, which will only lead to headache :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

thanks guys.got the the clicks to work. next question if i save a image has an bitmap image and want to click it at the x,y location when image loads? because sometime it take a bit longer to load cuz of the connections.. 

and also how can i start and stop a script cuz of sometimes when it misses and i want to stop it?

thanks for everything

Link to comment
Share on other sites

  • Moderators

J1 is asking the same question that has been asked since post #3. What application are you trying to automate?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...