annotate sikuli/PS.sikuli/PS.html @ 2:46fb79167a61 tip

Main Code
author Victor Padilla <victor.padilla.mc@gmail.com>
date Mon, 04 May 2015 22:56:18 +0200
parents
children
rev   line source
victor@2 1
victor@2 2 <html>
victor@2 3 <head>
victor@2 4 <style type="text/css">
victor@2 5 .sikuli-code {
victor@2 6 font-size: 20px;
victor@2 7 font-family: "Osaka-mono", Monospace;
victor@2 8 line-height: 1.5em;
victor@2 9 display:table-cell;
victor@2 10 white-space: pre-wrap; /* css-3 */
victor@2 11 white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
victor@2 12 white-space: -pre-wrap; /* Opera 4-6 */
victor@2 13 white-space: -o-pre-wrap; /* Opera 7 */
victor@2 14 word-wrap: break-word; /* Internet Explorer 5.5+ */
victor@2 15 width: 99%; /* remove horizontal scroll-bar when viewing in IE7 */
victor@2 16 }
victor@2 17 .sikuli-code img {
victor@2 18 vertical-align: middle;
victor@2 19 margin: 2px;
victor@2 20 border: 1px solid #ccc;
victor@2 21 padding: 2px;
victor@2 22 -moz-border-radius: 5px;
victor@2 23 -webkit-border-radius: 5px;
victor@2 24 -moz-box-shadow: 1px 1px 1px gray;
victor@2 25 -webkit-box-shadow: 1px 1px 2px gray;
victor@2 26 }
victor@2 27 .kw {
victor@2 28 color: blue;
victor@2 29 }
victor@2 30 .skw {
victor@2 31 color: rgb(63, 127, 127);
victor@2 32 }
victor@2 33
victor@2 34 .str {
victor@2 35 color: rgb(128, 0, 0);
victor@2 36 }
victor@2 37
victor@2 38 .dig {
victor@2 39 color: rgb(128, 64, 0);
victor@2 40 }
victor@2 41
victor@2 42 .cmt {
victor@2 43 color: rgb(200, 0, 200);
victor@2 44 }
victor@2 45
victor@2 46 h2 {
victor@2 47 display: inline;
victor@2 48 font-weight: normal;
victor@2 49 }
victor@2 50
victor@2 51 .info {
victor@2 52 border-bottom: 1px solid #ddd;
victor@2 53 padding-bottom: 5px;
victor@2 54 margin-bottom: 20px;
victor@2 55 display: none;
victor@2 56 }
victor@2 57
victor@2 58 a {
victor@2 59 color: #9D2900;
victor@2 60 }
victor@2 61
victor@2 62 body {
victor@2 63 font-family: "Trebuchet MS", Arial, Sans-Serif;
victor@2 64 }
victor@2 65
victor@2 66 </style>
victor@2 67 </head>
victor@2 68 <body>
victor@2 69 <div class="info">
victor@2 70 <h2>PS.sikuli\PS.sikuli</h2> <a href="PS.sikuli\PS.zip">(Download this script)</a>
victor@2 71 </div>
victor@2 72 <pre class="sikuli-code">
victor@2 73 params = sys.argv[<span class="dig">1</span>:]
victor@2 74 path=params[<span class="dig">0</span>]
victor@2 75 strIMGs=<span class="str">""</span>
victor@2 76
victor@2 77 <span class="skw">click</span>(<img src="1415626157985.png" />)
victor@2 78 <span class="skw">wait</span>(<img src="1415626436439.png" />,FOREVER)
victor@2 79 <span class="skw">type</span>(<span class="str">"o"</span>, KeyModifier.CTRL)
victor@2 80 <span class="skw">wait</span>(<img src="1415791940762.png" />,FOREVER)
victor@2 81 <span class="cmt">#click("1415882981586.png")
victor@2 82 </span><span class="skw">click</span>(Pattern(<img src="1415963511508.png" />).targetOffset(<span class="dig">45</span>,<span class="dig">14</span>))
victor@2 83 <span class="skw">type</span>(Key.BACKSPACE)
victor@2 84 paste(path)
victor@2 85 <span class="skw">click</span>(<img src="2014-11-13_12-53-25.png" />)
victor@2 86 <span class="skw">click</span>(<img src="1415791956757.png" />)
victor@2 87
victor@2 88 <span class="kw">for</span> i <span class="kw">in</span> range(<span class="dig">1</span>,len(params)):
victor@2 89 strIMGs=strIMGs+<span class="str">" \""</span>+params[i]+<span class="str">"\""</span>
victor@2 90 strInput=strIMGs
victor@2 91 strInput=strInput.replace(<span class="str">"/"</span>,<span class="str">"\\"</span>)
victor@2 92
victor@2 93 paste(strInput)
victor@2 94 <span class="skw">click</span>(<img src="1415791980822.png" />)
victor@2 95
victor@2 96 <span class="skw">wait</span>(<img src="1415628223695.png" />,FOREVER)
victor@2 97
victor@2 98 <span class="kw">if</span>(len(params)==<span class="dig">3</span>):
victor@2 99 <span class="skw">wait</span>(Pattern(<img src="1415785439675.png" />).exact(),FOREVER)
victor@2 100 <span class="kw">if</span>(len(params)==<span class="dig">4</span>):
victor@2 101 <span class="skw">wait</span>(Pattern(<img src="1415785928359.png" />).exact(),FOREVER)
victor@2 102 <span class="kw">if</span>(len(params)==<span class="dig">5</span>):
victor@2 103 <span class="skw">wait</span>(Pattern(<img src="1415786066894.png" />).exact(),FOREVER)
victor@2 104 <span class="kw">if</span>(len(params)==<span class="dig">6</span>):
victor@2 105 <span class="skw">wait</span>(Pattern(<img src="1415876625654.png" />).exact(),FOREVER)
victor@2 106 <span class="kw">if</span>(len(params)==<span class="dig">7</span>):
victor@2 107 <span class="skw">wait</span>(Pattern(<img src="1415876704875.png" />).exact(),FOREVER)
victor@2 108 <span class="kw">if</span>(len(params)==<span class="dig">8</span>):
victor@2 109 <span class="skw">wait</span>(Pattern(<img src="1415876822838.png" />).exact(),FOREVER)
victor@2 110 <span class="kw">if</span>(len(params)==<span class="dig">9</span>):
victor@2 111 <span class="skw">wait</span>(Pattern(<img src="1415876912038.png" />).exact(),FOREVER)
victor@2 112 <span class="kw">if</span>(len(params)==<span class="dig">10</span>):
victor@2 113 <span class="skw">wait</span>(Pattern(<img src="1416238736460.png" />).exact(),FOREVER)
victor@2 114 <span class="kw">if</span>(len(params)==<span class="dig">11</span>):
victor@2 115 <span class="skw">wait</span>(Pattern(<img src="1416238784250.png" />).exact(),FOREVER)
victor@2 116 <span class="kw">if</span>(len(params)==<span class="dig">12</span>):
victor@2 117 <span class="skw">wait</span>(Pattern(<img src="1416239106139.png" />).exact(),FOREVER)
victor@2 118 <span class="kw">if</span>(len(params)==<span class="dig">13</span>):
victor@2 119 <span class="skw">wait</span>(Pattern(<img src="1416239184735.png" />).exact(),FOREVER)
victor@2 120 <span class="kw">if</span>(len(params)==<span class="dig">14</span>):
victor@2 121 <span class="skw">wait</span>(Pattern(<img src="1417434097757.png" />).exact(),FOREVER)
victor@2 122
victor@2 123
victor@2 124 <span class="skw">click</span>(<img src="1415628257531.png" />)
victor@2 125 <span class="skw">wait</span>(<img src="1415792044614.png" />,FOREVER)
victor@2 126 <span class="skw">type</span>(Key.BACKSPACE)
victor@2 127 <span class="skw">click</span>(<img src="1415792076797.png" />)
victor@2 128 strOUT=path+<span class="str">"PS.xml"</span>
victor@2 129 strOUT=strOUT.replace(<span class="str">"/"</span>,<span class="str">"\\"</span>)
victor@2 130 paste(strOUT)
victor@2 131 <span class="skw">click</span>(<img src="1415792095379.png" />)
victor@2 132 <span class="kw">if</span> exists(<img src="1415700984115.png" />):
victor@2 133 <span class="skw">click</span>(<img src="1415700984115.png" />)
victor@2 134 <span class="kw">if</span> exists(<img src="cerrar.png" />):
victor@2 135 <span class="skw">click</span>(<img src="cerrar.png" />)
victor@2 136 </pre>
victor@2 137 </body>
victor@2 138 </html>