Macros

Discuss RoboTask here
Post Reply
pozzo
Posts: 4
Joined: Sat Jun 09, 2012 6:59 pm

Macros

Post by pozzo »

HelloI need to automate the following repetitive task with Robotask, using Windows 8, in order to use my LED TV as a monitor:1 - On the Desktop I click the mouse right button2 - Then I left click on Screen resolution option3 - When the Screen resolution screen appears I left click the Detect option4 - Then I close the screen and I´m readyI tried to record a macro but it doesn´t work.Below the macro logI: 09/06/2012 16:55:49: ****** Starting task: tv ******************I: 09/06/2012 16:55:49: Executing "1.//Begin of MacroRecoder block"I: 09/06/2012 16:55:49: Executing "2.Move To Object"E: 09/06/2012 16:55:49: Control (caption="FolderView", class="SysListView32") not foundE: 09/06/2012 16:55:49: An error occurred. Step #2 (Move To Object).E: 09/06/2012 16:55:49: Task execution is abortedPerhaps you know a better way of doing that...
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Macros

Post by Oleg »

If you want to record mouse actions on desktop it's better to use absolute coordinates. Press "Settings" button of macrorecorder and set this option. Recorder uses smart mode by default.

Next, when window is opened you can record next block of mouse actions. Don't forget to put some pause between macrorecorder blocks.

The task will be like this:
send keystrore #(D) //Win-D to clear desktop
mouse recorder block // absolute coordinates
pause 500 ms
mouse recorder block // smart mode
pozzo
Posts: 4
Joined: Sat Jun 09, 2012 6:59 pm

Macros

Post by pozzo »

OlegThank you for your attention.Now it works without error messages but still doesn´t do what I need.Would you please take a look at my action list below?[Root]item0000=STRINGLISTitem0001=STRINGLISTitem0002=STRINGLISTitem0003=STRINGLISTitem0004=STRINGLISTitem0005=STRINGLISTitem0006=STRINGLISTitem0007=STRINGLISTitem0008=STRINGLISTitem0009=STRINGLISTitem0010=STRINGLISTitem0011=STRINGLISTitem0012=STRINGLISTitem0013=STRINGLIST[\item0000]s1=[General]s2=ActionId=A_MISC_COMMENTs3=Name=//Begin of MacroRecoder blocks4=Enabled=-1s5=[Params]s6=comment=Begin of MacroRecoder block[\item0001]s1=[General]s2=ActionId=A_GENERAL_SENDKEYSs3=Name=Send keys to active windows4=Enabled=-1s5=[Params]s6=currentwindow=1s7=fixedwindow=1s8=keylayout=0s9=keys="Hello World!"s10=pause=20s11=release=0s12=sendkind=0s13=wincaption=Notepad[\item0002]s1=[General]s2=ActionId=A_MOUSE_MOVEs3=Name=Absolute Moves4=Enabled=-1s5=[Params]s6=dx=610s7=dy=230s8=mode=0[\item0003]s1=[General]s2=ActionId=A_MOUSE_CLICKs3=Name=Click buttons4=Enabled=-1s5=[Params]s6=action=0s7=button=1[\item0004]s1=[General]s2=ActionId=A_GENERAL_PAUSEs3=Name=Delays4=Enabled=-1s5=[Params]s6=delay=20[\item0005]s1=[General]s2=ActionId=A_MOUSE_MOVEs3=Name=Local Moves4=Enabled=-1s5=[Params]s6=dx=97s7=dy=280s8=mode=1[\item0006]s1=[General]s2=ActionId=A_MOUSE_CLICKs3=Name=Click buttons4=Enabled=-1s5=[Params]s6=action=0s7=button=0[\item0007]s1=[General]s2=ActionId=A_GENERAL_PAUSEs3=Name=Delays4=Enabled=-1s5=[Params]s6=delay=23[\item0008]s1=[General]s2=ActionId=A_MOUSE_MOVEs3=Name=Absolute Moves4=Enabled=-1s5=[Params]s6=dx=936s7=dy=162s8=mode=0[\item0009]s1=[General]s2=ActionId=A_MOUSE_CLICKs3=Name=Click buttons4=Enabled=-1s5=[Params]s6=action=0s7=button=0[\item0010]s1=[General]s2=ActionId=A_GENERAL_PAUSEs3=Name=Delays4=Enabled=-1s5=[Params]s6=delay=17[\item0011]s1=[General]s2=ActionId=A_MOUSE_MOVEs3=Name=Absolute Moves4=Enabled=-1s5=[Params]s6=dx=1243s7=dy=7s8=mode=0[\item0012]s1=[General]s2=ActionId=A_MOUSE_CLICKs3=Name=Click buttons4=Enabled=-1s5=[Params]s6=action=0s7=button=0[\item0013]s1=[General]s2=ActionId=A_MISC_COMMENTs3=Name=//End of MacroRecoder blocks4=Enabled=-1s5=[Params]s6=comment=End of MacroRecoder block
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Macros

Post by Oleg »

Why do you need sending "Hello world" string?
If you need to to right-click on the desktop you need send #(D) string (Win-D key)
Win-D combination clears your desktop.

Your task should be like this:

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1663346572
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task733"
Hide=INTEGER|0
ID=INTEGER|1528445005
LogOnAsUser=INTEGER|1
Name=STRING|"Send keys to active window..."
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER

[Actions\Action1\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"1"
keylayout=STRING|"0"
keys=STRING|"#(D)"
pause=STRING|"20"
release=STRING|"0"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"

[Actions\Action10]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//Begin of MacroRecoder block"
Params=FOLDER

[Actions\Action10\Params]
comment=STRING|"Begin of MacroRecoder block"

[Actions\Action11]
ActionID=STRING|"A_MOUSE_MOVETO"
Enabled=INTEGER|-1
Name=STRING|"Move To Object"
Params=FOLDER

[Actions\Action11\Params]
bottom=STRING|"120"
controlclass=STRING|"Button"
controltext=STRING|"Dete&ct"
ctrltextexact=STRING|"1"
left=STRING|"741"
right=STRING|"817"
top=STRING|"97"
windowclass=STRING|"CabinetWClass"
windowtext=STRING|"Screen Resolution"
wintextexact=STRING|"0"
x=STRING|"39"
y=STRING|"13"

[Actions\Action12]
ActionID=STRING|"A_MOUSE_CLICK"
Enabled=INTEGER|-1
Name=STRING|"Click button"
Params=FOLDER

[Actions\Action12\Params]
action=STRING|"0"
button=STRING|"0"

[Actions\Action13]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay"
Params=FOLDER

[Actions\Action13\Params]
delay=STRING|"22"

[Actions\Action14]
ActionID=STRING|"A_MOUSE_MOVETO"
Enabled=INTEGER|-1
Name=STRING|"Move To Object"
Params=FOLDER

[Actions\Action14\Params]
bottom=STRING|"0"
controlclass=STRING|""
controltext=STRING|""
ctrltextexact=STRING|"1"
left=STRING|"0"
right=STRING|"0"
top=STRING|"0"
windowclass=STRING|"CabinetWClass"
windowtext=STRING|"Control Panel\All Control Panel Items\Display\Screen Resolution"
wintextexact=STRING|"0"
x=STRING|"1056"
y=STRING|"-18"

[Actions\Action15]
ActionID=STRING|"A_MOUSE_CLICK"
Enabled=INTEGER|-1
Name=STRING|"Click button"
Params=FOLDER

[Actions\Action15\Params]
action=STRING|"0"
button=STRING|"0"

[Actions\Action16]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//End of MacroRecoder block"
Params=FOLDER

[Actions\Action16\Params]
comment=STRING|"End of MacroRecoder block"

[Actions\Action2]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//Begin of MacroRecoder block"
Params=FOLDER

[Actions\Action2\Params]
comment=STRING|"Begin of MacroRecoder block"

[Actions\Action3]
ActionID=STRING|"A_MOUSE_MOVE"
Enabled=INTEGER|-1
Name=STRING|"Absolute Move"
Params=FOLDER

[Actions\Action3\Params]
dx=STRING|"815"
dy=STRING|"500"
mode=STRING|"0"

[Actions\Action4]
ActionID=STRING|"A_MOUSE_CLICK"
Enabled=INTEGER|-1
Name=STRING|"Click button"
Params=FOLDER

[Actions\Action4\Params]
action=STRING|"0"
button=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay"
Params=FOLDER

[Actions\Action5\Params]
delay=STRING|"19"

[Actions\Action6]
ActionID=STRING|"A_MOUSE_MOVE"
Enabled=INTEGER|-1
Name=STRING|"Local Move"
Params=FOLDER

[Actions\Action6\Params]
dx=STRING|"73"
dy=STRING|"259"
mode=STRING|"1"

[Actions\Action7]
ActionID=STRING|"A_MOUSE_CLICK"
Enabled=INTEGER|-1
Name=STRING|"Click button"
Params=FOLDER

[Actions\Action7\Params]
action=STRING|"0"
button=STRING|"0"

[Actions\Action8]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//End of MacroRecoder block"
Params=FOLDER

[Actions\Action8\Params]
comment=STRING|"End of MacroRecoder block"

[Actions\Action9]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1000 ms"
Params=FOLDER

[Actions\Action9\Params]
delay=STRING|"10"
pozzo
Posts: 4
Joined: Sat Jun 09, 2012 6:59 pm

Macros

Post by pozzo »

Sorry, not yet.Here is the log:I: 10/06/2012 11:21:25: ****** Starting task: tv ******************I: 10/06/2012 11:21:25: Executing "1.Send keys to active window"I: 10/06/2012 11:21:25: Executing "2.//Begin of MacroRecoder block"I: 10/06/2012 11:21:25: Executing "3.Absolute Move"I: 10/06/2012 11:21:25: Executing "4.Click button"I: 10/06/2012 11:21:25: Executing "5.Delay"I: 10/06/2012 11:21:27: Executing "6.Local Move"I: 10/06/2012 11:21:27: Executing "7.Click button"I: 10/06/2012 11:21:27: Executing "8.//End of MacroRecoder block"I: 10/06/2012 11:21:27: Executing "9.Delay 1000 ms"I: 10/06/2012 11:21:28: Executing "10.//Begin of MacroRecoder block"I: 10/06/2012 11:21:28: Executing "11.Move To Object"E: 10/06/2012 11:21:28: Window (caption="Screen Resolution", class="CabinetWClass") not foundE: 10/06/2012 11:21:28: An error occurred. Step #11 (Move To Object).E: 10/06/2012 11:21:28: Task execution is aborted
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Macros

Post by Oleg »

This task is designed for my computer and my environment.
I put this task as example only and I can't guarantee that it will work in your computer.

Of course you should edit this task for your environment or record new sequences on your own computer.
pozzo
Posts: 4
Joined: Sat Jun 09, 2012 6:59 pm

Macros

Post by pozzo »

OKThank you again
Post Reply