diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sikuli/PS.sikuli/PS.html	Mon May 04 22:56:18 2015 +0200
@@ -0,0 +1,138 @@
+
+<html>
+   <head>
+      <style type="text/css">
+         .sikuli-code {
+            font-size: 20px;
+            font-family: "Osaka-mono", Monospace;
+            line-height: 1.5em;
+            display:table-cell;
+            white-space: pre-wrap;       /* css-3 */
+            white-space: -moz-pre-wrap !important;  /* Mozilla, since 1999 */
+            white-space: -pre-wrap;      /* Opera 4-6 */
+            white-space: -o-pre-wrap;    /* Opera 7 */
+            word-wrap: break-word;       /* Internet Explorer 5.5+ */
+            width: 99%;   /* remove horizontal scroll-bar when viewing in IE7 */
+         }
+         .sikuli-code img {
+            vertical-align: middle;
+            margin: 2px;
+            border: 1px solid #ccc;
+            padding: 2px;
+            -moz-border-radius: 5px;
+            -webkit-border-radius: 5px;
+            -moz-box-shadow: 1px 1px 1px gray;
+            -webkit-box-shadow: 1px 1px 2px gray;
+         }
+         .kw {
+            color: blue;
+         }
+         .skw {
+            color: rgb(63, 127, 127);
+         }
+
+         .str {
+            color: rgb(128, 0, 0);
+         }
+
+         .dig {
+            color: rgb(128, 64, 0);
+         }
+
+         .cmt {
+            color: rgb(200, 0, 200);
+         }
+
+         h2 {
+            display: inline;
+            font-weight: normal;
+         }
+
+         .info {
+            border-bottom: 1px solid #ddd;
+            padding-bottom: 5px;
+            margin-bottom: 20px;
+            display: none;
+         }
+
+         a {
+            color: #9D2900;
+         }
+
+         body {
+            font-family: "Trebuchet MS", Arial, Sans-Serif;
+         }
+
+      </style>
+   </head>
+<body>
+<div class="info">
+<h2>PS.sikuli\PS.sikuli</h2> <a href="PS.sikuli\PS.zip">(Download this script)</a>
+</div>
+<pre class="sikuli-code">
+params = sys.argv[<span class="dig">1</span>:]
+path=params[<span class="dig">0</span>]
+strIMGs=<span class="str">""</span>
+
+<span class="skw">click</span>(<img src="1415626157985.png" />)
+<span class="skw">wait</span>(<img src="1415626436439.png" />,FOREVER)
+<span class="skw">type</span>(<span class="str">"o"</span>, KeyModifier.CTRL)
+<span class="skw">wait</span>(<img src="1415791940762.png" />,FOREVER)
+<span class="cmt">#click("1415882981586.png")
+</span><span class="skw">click</span>(Pattern(<img src="1415963511508.png" />).targetOffset(<span class="dig">45</span>,<span class="dig">14</span>))
+<span class="skw">type</span>(Key.BACKSPACE)
+paste(path)
+<span class="skw">click</span>(<img src="2014-11-13_12-53-25.png" />)
+<span class="skw">click</span>(<img src="1415791956757.png" />)
+
+<span class="kw">for</span> i <span class="kw">in</span> range(<span class="dig">1</span>,len(params)):
+    strIMGs=strIMGs+<span class="str">" \""</span>+params[i]+<span class="str">"\""</span>
+strInput=strIMGs
+strInput=strInput.replace(<span class="str">"/"</span>,<span class="str">"\\"</span>)
+
+paste(strInput)
+<span class="skw">click</span>(<img src="1415791980822.png" />)
+
+<span class="skw">wait</span>(<img src="1415628223695.png" />,FOREVER)
+
+<span class="kw">if</span>(len(params)==<span class="dig">3</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1415785439675.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">4</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1415785928359.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">5</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1415786066894.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">6</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1415876625654.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">7</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1415876704875.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">8</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1415876822838.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">9</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1415876912038.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">10</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1416238736460.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">11</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1416238784250.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">12</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1416239106139.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">13</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1416239184735.png" />).exact(),FOREVER)
+<span class="kw">if</span>(len(params)==<span class="dig">14</span>):
+    <span class="skw">wait</span>(Pattern(<img src="1417434097757.png" />).exact(),FOREVER)
+
+
+<span class="skw">click</span>(<img src="1415628257531.png" />)
+<span class="skw">wait</span>(<img src="1415792044614.png" />,FOREVER)
+<span class="skw">type</span>(Key.BACKSPACE)
+<span class="skw">click</span>(<img src="1415792076797.png" />)
+strOUT=path+<span class="str">"PS.xml"</span>
+strOUT=strOUT.replace(<span class="str">"/"</span>,<span class="str">"\\"</span>)
+paste(strOUT)
+<span class="skw">click</span>(<img src="1415792095379.png" />)
+<span class="kw">if</span> exists(<img src="1415700984115.png" />):
+    <span class="skw">click</span>(<img src="1415700984115.png" />)
+<span class="kw">if</span> exists(<img src="cerrar.png" />):
+    <span class="skw">click</span>(<img src="cerrar.png" />)
+</pre>
+</body>
+</html>