├── 20180529212133.png ├── 20180529214753.png ├── LICENSE ├── README.md ├── TagUI_Editor.ahk ├── TagUI_Editor.exe ├── TagUI_Editor.gif ├── Tagui-Writer1.03.ahk ├── examples ├── DDGcrawler ├── mailtemp ├── meteo ├── stock └── subitoautoresponder └── screenshoter.ahk /20180529212133.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adegard/tagui_scripts/0ede452b768600041469899ef3ccef76583f1474/20180529212133.png -------------------------------------------------------------------------------- /20180529214753.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adegard/tagui_scripts/0ede452b768600041469899ef3ccef76583f1474/20180529214753.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

TagUI Editor:

2 | Easily modify, run and schedule your TagUI scripts on Windows. Get TagUI here: https://github.com/kelaberetiv/TagUI 3 | See this Tutorial How to Install TagUI 4 |

5 | 6 | Installer: 7 | - Run TagUI_Editor.exe 8 | - In Windows Warning, Continue and Yes 9 | 10 | Source Code (ahk file): 11 | - Install AutoHotKey : https://autohotkey.com/ 12 | - save and launch TagUI_Editor.ahk 13 | 14 | Known issues: 15 | - Folders name: put tagui files in folders without any spaces, like: C:\your-tagui-path\ 16 | - Save your tagui files before execute them! (you can save it as yourname.tagui or without file extension) 17 | - If you launch Tagui files outside your tagui path, you need to set all comand in variable path environment: CasperJs, Sleimmerjs, PHP...ie: if you path is "C:\tagui\tagui": 18 | PATH: C:\tagui\tagui\src,C:\tagui\tagui\src\phantomjs\bin, C:\tagui\tagui\src\casperjs\bin, C:\tagui\tagui\src\php 19 | (how to do that) 20 |
21 | 22 | 23 | 24 | 25 |

TagUI Code Writer: Tagui-Writer1.0x

26 | Easily print in your code little snippets (examples) in TagUI language: 27 |
28 | 29 | 30 | # Why This ? 31 | TagUI (reference: https://github.com/kelaberetiv/TagUI) is very powerful program which use native language for web-scraping and RPA (Robotic Process Automation), but at the begin it could be a bit tricky to find and remember all commands. Then I built this tool to simplify and accelerate coding. Enjoy! 32 | 33 | # Installation (Windows) 34 | 35 | Source file (ahk file): 36 | - Install AutoHotKey : https://autohotkey.com/ 37 | - Open Editor of your choice (Notepad++ is great) 38 | - save and launch Tagui-Writer1.03.ahk 39 | - Ctrl+left Click to show Menu and insert code 40 | 41 | # Uninstall 42 | no need of uninstaller, just delete the file (close it before : left click and choose "Exit App") 43 | 44 |

ScreenShoter: screenshoter.ahk

45 | Capture screen shots and save it directly in png file! 46 | 47 | 48 | # Why This ? 49 | Capture screen shots for Visual automation (Tagui - Sikuli) is time-consuming. Then this tool could help you increase your bot coding productivity. 50 | 51 | Use screenshots in TagUI - Sikuli integration, to identify web elements and desktop user interface elements..., i.e.: 52 | click image.png 53 | 54 | # Installation 55 | 56 | Source (ahk file): 57 | - Install AutoHotKey 58 | - save and launch https://github.com/adegard/tagui_scripts/blob/master/screenshoter.ahk 59 | - Press Printkey to start, to finish (red rectangle) and to save file (3 times) 60 | 61 | # Contributions 62 | Blog: [https://simplestipsandtricks.blogspot.com/](https://simplestipsandtricks.blogspot.com/) 63 | 64 | Youtube chanel 65 |
66 | Donate 67 | 68 | # Books 69 | 70 | **Web Robots: Boost your business with Robotic Process Automation and Web-Scraping on Web-marketing** : 71 | ![](https://images-na.ssl-images-amazon.com/images/i/7190amtcrvl.sr160,240_bg243,243,243.jpg) 72 | https://www.amazon.com/Arnaud-Degardin/e/B07HLM1TXY/ref=sr_ntt_srch_lnk_3?qid=1537947864&sr=8-3 73 | -------------------------------------------------------------------------------- /TagUI_Editor.ahk: -------------------------------------------------------------------------------- 1 | ;@A.DEGARDIN 2018, TagUI_Editor.ahk : Create and test your TagUI scripts 2 | ;Put this ahk script in the TagUI directory 3 | 4 | ;DOWNLOAD 'TagUI' form: https://github.com/kelaberetiv/TagUI 5 | ;thanks to @Ken Soh and his team of AI Singapore! 6 | 7 | #SingleInstance Force 8 | #NoEnv 9 | SetBatchLines -1 10 | 11 | SetWorkingDir, A_ScriptDir ; or specify TagUI directory C:\TagUI\tagui 12 | 13 | Menu, tray, icon, %A_WinDir%\system32\shell32.dll, 262 14 | Menu, FileMenu, Add, &New (Ctrl+N), FileNew 15 | Menu, FileMenu, Add, &Open (Ctrl+O), FileOpen 16 | Menu, FileMenu, Add, &Save (Ctrl+S), FileSave 17 | Menu, FileMenu, Add, Save &As, FileSaveAs 18 | Menu, FileMenu, Add ; Separator line. 19 | Menu, FileMenu, Add, &Exit, FileExit 20 | Menu, HelpMenu, Add, &About TagUI, HelpAbout 21 | Menu, HelpMenu, Add, &About TagUI_Editor, TagUI_editor 22 | Menu, Execute, Add, &Chrome Visible, Execute_chrome_visible 23 | Menu, Execute, Add, &Chrome Headless, Execute_chrome_headless 24 | Menu, Execute, Add, &Firefox, Execute_firefox_visible 25 | Menu, Schedule, Add, &Schedule Daily, ScheduleDaily 26 | ;************************INSERT FUNCTIONS****************************************** 27 | ;***********Navigate Webpage******************* 28 | ;****************************** 29 | Menu,WebScraping_Pointer,Add,Go to specified webpage, go_to_url 30 | Menu,WebScraping_Pointer,Icon,Go to specified webpage, %A_windir%\system32\shell32.dll,18 31 | Menu,Insert, Add, Webpage, :WebScraping_Pointer 32 | Menu,Insert,Icon,Webpage, %A_WinDir%\system32\SHELL32.dll, 18 ; %A_WinDir%\system32\imageres.dll, 18 33 | 34 | ;****************************** 35 | ;***********Click******************* 36 | ;****************************** 37 | Menu,WebScraping_Click,Add,Click on Element, WebScraping_Click 38 | Menu,WebScraping_Click,Icon,Click on Element, %A_windir%\system32\shell32.dll,100 39 | Menu,WebScraping_Click,Add,Click on image, WebScraping_image 40 | Menu,WebScraping_Click,Icon,Click on image, %A_windir%\system32\shell32.dll,100 41 | Menu,WebScraping_Click,Add,Click on current mouse position, WebScraping_mouse 42 | Menu,WebScraping_Click,Icon,Click on current mouse position, %A_windir%\system32\shell32.dll,100 43 | Menu,WebScraping_Click,Add,Click on Text, WebScraping_text 44 | Menu,WebScraping_Click,Icon,Click on Text, %A_windir%\system32\shell32.dll,75 45 | Menu,WebScraping_Click,Add,move cursor to element,WebScraping_Click_Focus 46 | Menu,WebScraping_Click,Icon,move cursor to element, %A_windir%\system32\shell32.dll,101 47 | 48 | Menu,Insert,Add,Click, :WebScraping_Click ;*********** ******************* 49 | Menu,Insert,Icon,Click, %A_WinDir%\system32\mmcndmgr.dll,51 50 | 51 | ;*************Set***************** 52 | Menu,WebScraping_set,Add,Enter text or variables or arrays, WebScraping_enter 53 | Menu,WebScraping_set,Add,Enter value from repository, WebScraping_enterrepo 54 | Menu,WebScraping_set,Add,Check a Checkbox, WebScraping_checkmybox 55 | Menu,WebScraping_set,Icon,Check a Checkbox, %A_windir%\system32\shell32.dll,217 56 | Menu,WebScraping_set,Add,Choose dropdown option, WebScraping_option 57 | Menu,WebScraping_set,Add,Press Enter key in element, WebScraping_pressenter 58 | 59 | Menu,Insert,Add,Set, :WebScraping_set ;*********** ******************* 60 | Menu,Insert,Icon,Set, %A_WinDir%\system32\shell32.dll,166 61 | 62 | 63 | ;*************Scrape***************** 64 | Menu,WebScraping_get,Add,Check text presence, WebScraping_checktext 65 | Menu,WebScraping_get,Icon,Check text presence, %A_windir%\system32\shell32.dll,219 66 | Menu,WebScraping_get,Add,Check element presence visible, WebScraping_checkelement 67 | Menu,WebScraping_get,Icon,Check element presence visible, %A_windir%\system32\shell32.dll,219 68 | Menu,WebScraping_get,Add,Return if checkbox is checked, WebScraping_checkbox 69 | Menu,WebScraping_get,Icon,Return if checkbox is checked, %A_windir%\system32\shell32.dll,217 70 | Menu,WebScraping_get,Add,Count items in dropdown select, WebScraping_dropdownitem 71 | Menu,WebScraping_get,Add,Getting attribute (like href) of elements, WebScraping_atribute 72 | Menu,WebScraping_get,Add,Read element text to variable, WebScraping_read 73 | Menu,WebScraping_get,Add,Print element text to output, WebScraping_print 74 | Menu,WebScraping_get,Add,Echo text/variables to output, WebScraping_echo 75 | Menu,WebScraping_get,Add,Echo url of webpage, WebScraping_url 76 | Menu,WebScraping_get,Icon,Echo url of webpage, %A_windir%\system32\shell32.dll,18 77 | Menu,WebScraping_get,Add,Echo text of webpage, WebScraping_webtext 78 | Menu,WebScraping_get,Icon,Echo text of webpage, %A_windir%\system32\shell32.dll,18 79 | Menu,WebScraping_get,Add,Echo OCR of image of webpage, WebScraping_OCR 80 | Menu,WebScraping_get,Icon,Echo OCR of image of webpage, %A_windir%\system32\shell32.dll,18 81 | Menu,WebScraping_get,Add,Save screenshot to file, WebScraping_snap 82 | Menu,WebScraping_get,Icon,Save screenshot to file, %A_windir%\system32\shell32.dll,140 83 | Menu,WebScraping_get,Add,Snap page, WebScraping_snappage 84 | Menu,WebScraping_get,Icon,Snap page, %A_windir%\system32\shell32.dll,140 85 | Menu,WebScraping_get,Add,Save webpage to pdf, WebScraping_snap_pdf 86 | Menu,WebScraping_get,Icon,Save webpage to pdf, %A_windir%\system32\shell32.dll,76 87 | Menu,WebScraping_get,Add,Save basic html table to csv, WebScraping_table 88 | Menu,WebScraping_get,Icon,Save basic html table to csv, %A_windir%\system32\shell32.dll,115 89 | Menu,WebScraping_get,Add,Count elements on page, WebScraping_countel 90 | Menu,WebScraping_get,Icon,Count elements on page, %A_windir%\system32\shell32.dll,166 91 | Menu,WebScraping_get,Add,Scrap elements of table (loop), WebScraping_tableelements 92 | Menu,WebScraping_get,Icon,Scrap elements of table (loop), %A_windir%\system32\shell32.dll,166 93 | Menu,WebScraping_get,Add,Track time between events, WebScraping_timer 94 | Menu,WebScraping_get,Icon,Track time between events, %A_windir%\system32\shell32.dll,240 95 | 96 | Menu,Insert,Add,Scrape, :WebScraping_get ;*********** ******************* 97 | Menu,Insert,Icon,Scrape, %A_WinDir%\system32\shell32.dll,219 98 | 99 | ;*************File***************** 100 | Menu,WebScraping_file,Add,Save element text to file, WebScraping_save 101 | Menu,WebScraping_file,Add,Save text/variables to file, WebScraping_dump 102 | Menu,WebScraping_file,Add,Save informations to a csv file, WebScraping_csv 103 | Menu,WebScraping_file,Icon,Save informations to a csv file, %A_windir%\system32\shell32.dll,115 104 | Menu,WebScraping_file,Add,Append text/variables to file, WebScraping_append 105 | Menu,WebScraping_file,Add,Load file content to variable, WebScraping_load 106 | Menu,WebScraping_file,Add,COMPLETE EXAMPLE Search/Append content in File, WebScraping_content 107 | Menu,WebScraping_file,Add,upload file to website, WebScraping_upload 108 | Menu,WebScraping_file,Icon,upload file to website, %A_windir%\system32\shell32.dll,264 109 | Menu,WebScraping_file,Add,download from url to file, WebScraping_download 110 | Menu,WebScraping_file,Icon,download from url to file, %A_windir%\system32\shell32.dll,123 111 | Menu,WebScraping_file,Add,receive resource to file, WebScraping_receive 112 | 113 | 114 | Menu,Insert,Add,Save-Read File, :WebScraping_file ;*********** ******************* 115 | Menu,Insert,Icon,Save-Read File, %A_WinDir%\system32\shell32.dll,71 116 | 117 | 118 | ;*************Databases***************** 119 | Menu,WebScraping_db,Add,Take informations from repository, WebScraping_repo 120 | Menu,WebScraping_db,Icon,Take informations from repository, %A_windir%\system32\shell32.dll,55 121 | Menu,WebScraping_db,Add,Database example to crawl urls, WebScraping_db1 122 | Menu,WebScraping_db,Icon,Database example to crawl urls, %A_windir%\system32\shell32.dll,187 123 | Menu,WebScraping_db,Add,Database example for set of variables(arrays like), WebScraping_db2 124 | Menu,WebScraping_db,Icon,Database example for set of variables(arrays like), %A_windir%\system32\shell32.dll,187 125 | Menu,WebScraping_db,Add,MySQL Database access read and write, WebScraping_db3 126 | Menu,WebScraping_db,Icon,MySQL Database access read and write, %A_windir%\system32\shell32.dll,187 127 | 128 | Menu,Insert,Add,Databases/Repositories, :WebScraping_db ;*********** ******************* 129 | Menu,Insert,Icon,Databases/Repositories, %A_WinDir%\system32\shell32.dll,187 130 | 131 | 132 | 133 | 134 | ;*************Start***************** 135 | Menu,WebScraping_tagui,Add,Run tagui flow, WebScraping_run 136 | Menu,WebScraping_tagui,Icon,Run tagui flow, %A_windir%\system32\shell32.dll,215 137 | Menu,Insert,Add,Run script, :WebScraping_tagui ;*********** ******************* 138 | Menu,Insert,Icon,RUN script, %A_WinDir%\system32\shell32.dll,215 139 | 140 | ;*************Conditions***************** 141 | Menu,WebScraping_cond,Add,If text contain, WebScraping_ifcontain 142 | Menu,WebScraping_cond,Add,If value is more less, WebScraping_if 143 | Menu,WebScraping_cond,Add,If element present do action, WebScraping_present 144 | Menu,WebScraping_cond,Add,Check element present return text, WebScraping_checkpres 145 | Menu,WebScraping_cond,Add,Check number of elements return text, WebScraping_checkcount 146 | Menu,WebScraping_cond,Add,loop for, WebScraping_for 147 | Menu,Insert,Add,Conditions/loop, :WebScraping_cond ;*********** ******************* 148 | Menu,Insert,Icon,Conditions/loop, %A_WinDir%\system32\shell32.dll,145 149 | 150 | ;*************pro***************** 151 | Menu,WebScraping_pro,Add,wait for some time, WebScraping_wait 152 | Menu,WebScraping_pro,Add,enter live mode, WebScraping_live 153 | Menu,WebScraping_pro,Add,check condition and print result, WebScraping_check 154 | Menu,WebScraping_pro,Add,Access to frame in webpage, WebScraping_frame 155 | Menu,WebScraping_pro,Add,Access to second browser tab, WebScraping_popup 156 | Menu,WebScraping_pro,Add,Access under Proxy, WebScraping_proxy 157 | Menu,WebScraping_pro,Add,Integration with R, WebScraping_R 158 | 159 | 160 | Menu,Insert,Add,Pro steps, :WebScraping_pro ;*********** ******************* 161 | Menu,Insert,Icon,Pro steps, %A_WinDir%\system32\shell32.dll,72 162 | 163 | 164 | 165 | 166 | ;*************Javascript***************** 167 | Menu,WebScraping_js,Add,Find element attribute, WebScraping_attribute 168 | Menu,WebScraping_js,Add,Get list of element (dom), WebScraping_domloop 169 | Menu,WebScraping_js,Add,Save dom result in file, WebScraping_domsave 170 | Menu,WebScraping_js,Add,String replace (substitution of characters), WebScraping_substitute 171 | Menu,WebScraping_js,Add,String search (position of characters), WebScraping_indexof 172 | Menu,WebScraping_js,Add,String extraction (from a string), WebScraping_substring 173 | Menu,WebScraping_js,Add,Convert Lowercase/uppercase, WebScraping_case 174 | Menu,WebScraping_js,Add,Array declaration, WebScraping_array 175 | Menu,WebScraping_js,Add,Return date informazioni, WebScraping_dates 176 | Menu,WebScraping_js,Add,Calculate Random Value, WebScraping_random 177 | 178 | Menu, Insert,Add,Javascript, :WebScraping_js ;*********** ******************* 179 | Menu,Insert,Icon,Javascript, %A_WinDir%\system32\setupapi.dll,13 180 | 181 | ;********************************************************************************* 182 | 183 | Menu, MyMenuBar, Add, &File, :FileMenu 184 | Menu, MyMenuBar,Icon,&File, %A_WinDir%\system32\SHELL32.dll, 7 185 | Menu, MyMenuBar, Add, &Insert, :Insert 186 | Menu, MyMenuBar,Icon,&Insert, %A_WinDir%\system32\SHELL32.dll, 123 187 | Menu, MyMenuBar, Add, &Execute, :Execute 188 | Menu, MyMenuBar,Icon,&Execute, %A_WinDir%\system32\SHELL32.dll, 138 189 | Menu, MyMenuBar, Add, &Open Log, Log 190 | Menu, MyMenuBar,Icon,&Open Log, %A_WinDir%\system32\SHELL32.dll, 166 191 | Menu, MyMenuBar, Add, &Schedule, :Schedule 192 | Menu, MyMenuBar,Icon,&Schedule, %A_WinDir%\system32\SHELL32.dll, 240 193 | Menu, MyMenuBar, Add, &Help, :HelpMenu 194 | Menu, MyMenuBar,Icon,&Help, %A_WinDir%\system32\SHELL32.dll, 155 195 | 196 | ; Attach the menu bar to the window: 197 | Gui, Menu, MyMenuBar 198 | 199 | ; Create the main Edit control and display the window: 200 | Gui, +Resize ; Make the window resizable. 201 | 202 | Gui Add, Edit, vMainEdit x13 y39 w525 h450 +Multi 203 | Gui Add, Text, vFilenametext x13 y6 w525 h23 +0x200, Untitled 204 | 205 | Gui Show, w552 h466, TagUI_Editor 206 | Return 207 | 208 | CurrentFileName = ; Indicate that there is no current file. 209 | 210 | FileNew: 211 | GuiControl,, MainEdit ; Clear the Edit control. 212 | Gui, Show,, TagUI_Editor 213 | CurrentFileName = ; Indicate that there is no current file. 214 | GuiControl,, MainEdit, 215 | GuiControl,, Filenametext, Untitled 216 | 217 | 218 | return 219 | 220 | FileOpen: 221 | Gui +OwnDialogs ; Force the user to dismiss the FileSelectFile dialog before returning to the main window. 222 | FileSelectFile, SelectedFileName, 3,, Open File ;, Text Documents (*.txt) 223 | if SelectedFileName = ; No file selected. 224 | return 225 | Gosub FileRead 226 | return 227 | 228 | FileRead: ; Caller has set the variable SelectedFileName for us. 229 | FileRead, MainEdit, %SelectedFileName% ; Read the file's contents into the variable. 230 | if ErrorLevel 231 | { 232 | MsgBox Could not open "%SelectedFileName%". 233 | return 234 | } 235 | GuiControl,, MainEdit, %MainEdit% ; Put the text into the control. 236 | CurrentFileName = %SelectedFileName% 237 | GuiControl,, Filenametext, %SelectedFileName% 238 | 239 | ;Gui, Show,, %CurrentFileName% ; Show file name in title bar. 240 | return 241 | 242 | 243 | ^N:: 244 | Goto FileNew 245 | return 246 | 247 | 248 | ^O:: 249 | Goto FileOpen 250 | return 251 | 252 | 253 | ^S:: 254 | Goto FileSave 255 | return 256 | 257 | FileSave: 258 | if CurrentFileName = ; No filename selected yet, so do Save-As instead. 259 | Goto FileSaveAs 260 | Gosub SaveCurrentFile 261 | return 262 | 263 | FileSaveAs: 264 | Gui +OwnDialogs ; Force the user to dismiss the FileSelectFile dialog before returning to the main window. 265 | FileSelectFile, SelectedFileName, S16,, Save File ;, Text Documents (*.txt) 266 | ;FileSelectFile, SelectedFileName, 1,, Save File, AutoHotkey Scripts (*.ahk) 267 | 268 | if SelectedFileName = ; No file selected. 269 | return 270 | CurrentFileName = %SelectedFileName% 271 | GuiControl,, Filenametext, %SelectedFileName% 272 | Gosub SaveCurrentFile 273 | return 274 | 275 | SaveCurrentFile: ; Caller has ensured that CurrentFileName is not blank. 276 | IfExist %CurrentFileName% 277 | { 278 | FileDelete %CurrentFileName% 279 | if ErrorLevel 280 | { 281 | MsgBox The attempt to overwrite "%CurrentFileName%" failed. 282 | return 283 | } 284 | } 285 | GuiControlGet, MainEdit ; Retrieve the contents of the Edit control. 286 | FileAppend, %MainEdit%, %CurrentFileName% ;, AutoHotkey Scripts (*.ahk) ; Save the contents to the file. 287 | ; Upon success, Show file name in title bar (in case we were called by FileSaveAs): 288 | ;Gui, Show,, %CurrentFileName% 289 | 290 | return 291 | 292 | HelpAbout: 293 | run, https://github.com/kelaberetiv/TagUI 294 | return 295 | 296 | TagUI_editor: 297 | run, https://github.com/adegard/tagui_scripts 298 | return 299 | 300 | Execute_chrome_visible: 301 | 302 | if CurrentFileName = ; No filename selected yet, so do Save-As instead. 303 | Goto FileSaveAs 304 | Gosub SaveCurrentFile 305 | 306 | launchTagUI(CurrentFileName, "chrome") 307 | WinWait, ahk_exe cmd.exe 308 | WinMove, ahk_exe cmd.exe ,,(A_ScreenWidth)-(600) ,(A_ScreenHeight)-(400) , 600, 400 309 | return 310 | 311 | Execute_chrome_headless: 312 | 313 | if CurrentFileName = ; No filename selected yet, so do Save-As instead. 314 | Goto FileSaveAs 315 | Gosub SaveCurrentFile 316 | 317 | launchTagUI(CurrentFileName, "") 318 | WinWait, ahk_exe cmd.exe 319 | WinMove, ahk_exe cmd.exe ,,(A_ScreenWidth)-(600) ,(A_ScreenHeight)-(400) , 600, 400 320 | return 321 | 322 | 323 | Execute_firefox_visible: 324 | 325 | if CurrentFileName = ; No filename selected yet, so do Save-As instead. 326 | Goto FileSaveAs 327 | Gosub SaveCurrentFile 328 | 329 | launchTagUI(CurrentFileName, "firefox") 330 | WinWait, ahk_exe cmd.exe 331 | WinMove, ahk_exe cmd.exe ,,(A_ScreenWidth)-(600) ,(A_ScreenHeight)-(400) , 600, 400 332 | return 333 | 334 | 335 | Log: 336 | run, %CurrentFileName%.log 337 | return 338 | 339 | 340 | ScheduleDaily: 341 | 342 | GuiControlGet , mFile,, Filenametext 343 | 344 | If InStr(mFile, " ") 345 | { MsgBox, Path:%mFile% `n Phantomjs does not work with file paths that have spaces in them. Please Save it in other Path without spaces 346 | } 347 | else 348 | { 349 | ;create BAT FILE ************************************* 350 | 351 | BatFile=%mFile%.bat 352 | 353 | 354 | IfExist %BatFile% 355 | { 356 | FileDelete %BatFile% 357 | if ErrorLevel 358 | { 359 | MsgBox The attempt to overwrite "%BatFile%" failed. 360 | return 361 | } 362 | } 363 | 364 | 365 | batcontent= 366 | ( 367 | @echo off 368 | tagui.cmd "%mFile%" 369 | 370 | ) 371 | 372 | FileAppend, %batcontent%, %BatFile% 373 | 374 | Gui 2:Add, Text, x19 y9 w139 h23 +0x200, Add Daily Task: 375 | Gui 2:Add, Text, x16 y43 w120 h23 +0x200, Task Name: 376 | Gui 2:Add, Edit, vthistaskname x16 y71 w399 h21, My task 377 | Gui 2:Add, Text, x16 y99 w120 h23 +0x200, Batch File (.bat) Path: 378 | Gui 2:Add, Edit, vfile x16 y129 w335 h21 379 | Gui 2:Add, Button, x354 y129 w70 h21 gBROWSE, BROWSE 380 | Gui 2:Add, DateTime, vtime x15 y156 w120 h23 1, HH:mm 381 | Gui 2:Add, Button, x15 y233 w80 h23 gAddTaskDaily, ADD TASK 382 | Gui 2:Add, Button, x117 y232 w85 h23 gcheckTasks, CHECK TASKS 383 | Gui 2:Add, Button, x261 y232 w153 h23 gOpenScheduler, OPEN TASK SCHEDULER 384 | ;MsgBox, %mFile% 385 | GuiControl,2:, file, %mFile%.bat 386 | 387 | Gui 2:Show, w426 h270, Tasks Scheduler Windows 388 | } 389 | 390 | Return 391 | 392 | 2AddTaskDaily: 393 | 2OpenScheduler: 394 | 2GuiClose: 395 | 2GuiEscape: 396 | Gui, 1:-Disabled ; Re-enable the main window (must be done prior to the next step). 397 | Gui, 2: Destroy ; Destroy the about box. 398 | return 399 | 400 | 401 | BROWSE() 402 | { 403 | FileSelectFile, SelectedFile, 3, , Open a .bat file 404 | GuiControl,2:, file, %SelectedFile% 405 | } 406 | 407 | 408 | AddTaskDaily: 409 | 410 | GuiControlGet , sFile,, file 411 | GuiControlGet , staskname,, thistaskname 412 | GuiControlGet , stime,, time 413 | FormatTime, stime, %stime%, HH:mm 414 | sfrequency=DAILY 415 | ;MsgBox, SchTasks /Create /SC %sfrequency% /TN "%staskname%" /TR "%sfile%" /ST %stime% 416 | SheduleTask(staskname, sFile, stime, sfrequency) 417 | return 418 | 419 | 420 | ;**************************SCHEDULER WINDOWS***************** 421 | 422 | SheduleTask(mytaskname, file, time, frequency) 423 | { 424 | 425 | DelTask=SCHTASKS.exe /Create /SC %frequency% /TN "%mytaskname%" /TR "%file%" /ST %time% 426 | Run, %DelTask% 427 | 428 | } 429 | 430 | checkTasks: 431 | MsgBox,% GetTaskInfos() 432 | return 433 | 434 | GetTaskInfos() 435 | { 436 | objService := ComObjCreate("Schedule.Service") 437 | objService.Connect() 438 | rootFolder := objService.GetFolder("\") 439 | taskCollection := rootFolder.GetTasks(0) 440 | numberOfTasks := taskCollection.Count 441 | ; ?RegistrationInfo.Author 442 | For registeredTask, state in taskCollection 443 | { 444 | if (registeredTask.state == 0) 445 | state:= "Unknown" 446 | else if (registeredTask.state == 1) 447 | state:= "Disabled" 448 | else if (registeredTask.state == 2) 449 | state:= "Queued" 450 | else if (registeredTask.state == 3) 451 | state:= "Ready" 452 | else if (registeredTask.state == 4) 453 | state:= "Running" 454 | tasklist .= registeredTask.Name "=" state "`n" ; "=" registeredTask.state "`n" 455 | } 456 | return tasklist 457 | } 458 | ;************************************************** 459 | 460 | OpenScheduler: 461 | run, control schedtasks 462 | return 463 | 464 | 465 | GuiSize: 466 | if ErrorLevel = 1 ; The window has been minimized. No action needed. 467 | return 468 | ; Otherwise, the window has been resized or maximized. Resize the Edit control to match. 469 | NewWidth := A_GuiWidth - 20 470 | NewHeight := A_GuiHeight - 60 471 | GuiControl, Move, MainEdit, W%NewWidth% H%NewHeight% 472 | return 473 | 474 | 475 | FileExit: ; User chose "Exit" from the File menu. 476 | GuiClose: ; User closed the window. 477 | ExitApp 478 | 479 | 480 | Esc::ExitApp 481 | 482 | ;************TagUI Editor FUNCTIONS**************** 483 | 484 | 485 | launchTagUI(filetagui, browser) 486 | { 487 | 488 | If InStr(filetagui, " ") 489 | { 490 | MsgBox, Path:%mFile% `n Phantomjs does not work with file paths that have spaces in them. Please Save it in other Path without spaces 491 | } 492 | Else 493 | { 494 | DelTask=tagui.cmd "%filetagui%" %browser% 495 | Run, %DelTask% 496 | } 497 | 498 | 499 | 500 | } 501 | 502 | 503 | 504 | ;************************************************************************* 505 | 506 | 507 | 508 | 509 | WebScraping_repo: 510 | Store:=ClipboardAll ;****Store clipboard **** 511 | Clipboard= 512 | ( Join`r`n 513 | // repositories help to make objects or steps reusable and improve readability 514 | // save repository file with same name as your flow filename and with .csv behind 515 | // repository must have 2 columns, for example below (headers up to you to name) 516 | // using 'object' in your flow replaces it with its definition (which can contain objects) 517 | // for example during execution, 'click link' becomes click //*[@id="profile_full"]//a 518 | // if you have watched Inception movie, this is inception level 2 (capped at max 2 for now) 519 | // don't worry about mistakes, TagUI is usually able to tell you which line has what error 520 | 521 | // please note that in these precedent comments, the symbol ``` is replaced with ' 522 | // otherwise TagUI will try to interpret it as repository definition 523 | 524 | // contents of repository.csv 525 | // OBJECT,DEFINITION 526 | // email,quick_email 527 | // password,quick_pass 528 | // user_email,mickey_mouse@disney.com 529 | // user_password,iloveminnie4eva 530 | // show info,Show full information 531 | // click link,click ```facebook_link``` 532 | // facebook_link,//*[@id="profile_full"]//a 533 | 534 | // somes examples of use : 535 | enter ```email``` as ```user_email``` 536 | enter ```password``` as ```user_password``` 537 | click ```show info``` 538 | hover ```facebook_link``` 539 | wait 2.5 540 | ```click link``` 541 | wait 542 | ) 543 | Gosub Paste_and_Restore_Stored_Clipboard 544 | return 545 | 546 | 547 | WebScraping_db1: 548 | Store:=ClipboardAll ;****Store clipboard **** 549 | Clipboard= 550 | ( Join`r`n 551 | // datatables extend the power of repositories files to manage batch automation 552 | // datatable has 2 or more columns, for example below (headers up to you to name) 553 | // data-centric approach with rows representing data fields (usually row = test case) 554 | 555 | // Example : content of datatable.csv with the same name of tagui file 556 | // file in this format can be from flow 6A using JavaScript, or using Excel transpose function 557 | // 6B_GETCONTACT,#1,#2,#3 558 | // user_url,https://github.com/s0b0lev,https://github.com/zongUMR,https://github.com/jkmartindale 559 | 560 | ```user_url``` 561 | // TagUI loops through each column to automate using values from different datasets 562 | // for example, echo "URL - ```user_url```" in your flow shows URL - https://github.com/s0b0lev 563 | 564 | // read User Full Name and GitHub ID to variables 565 | read fullname to fullname 566 | read username to username 567 | echo fullname "," username 568 | ) 569 | Gosub Paste_and_Restore_Stored_Clipboard 570 | return 571 | 572 | 573 | WebScraping_db2: 574 | Store:=ClipboardAll ;****Store clipboard **** 575 | Clipboard= 576 | ( Join`r`n 577 | // contents of datatable.csv 578 | // DATA,#1,#2,#3 579 | // GITHUB_ID,ironman,batman,superman 580 | // USER_EMAIL,tony@stark.org,bruce@wayne.org,clarke@kent.org 581 | 582 | // TagUI loops through each column to automate using values from different datasets 583 | // set respective User IDs and User Emails and display to screen and log file 584 | 585 | // example of use : 586 | github_id = "```GITHUB_ID```" 587 | user_email = "```USER_EMAIL```"; 588 | echo github_id " - " user_email 589 | ) 590 | Gosub Paste_and_Restore_Stored_Clipboard 591 | return 592 | 593 | 594 | WebScraping_db3: 595 | Store:=ClipboardAll ;****Store clipboard **** 596 | Clipboard= 597 | ( Join`r`n 598 | // form sql query to read from database and save to os script 599 | // on mac/linux be sure that read_db file has execute permission 600 | sql_query = 'mysql DATABASE_NAME -e "SELECT NAME,EMAIL FROM TABLE_NAME"' 601 | dump sql_query to read_db 602 | 603 | // above assumes running as root user from server, if database credentials are required, use below - 604 | // sql_query = 'mysql DATABASE_NAME --user=username --password=\'password\' -e "SELECT NAME,EMAIL FROM TABLE_NAME"' 605 | 606 | // use run step to run the script and retrieve results 607 | run /full_path_to_flow/read_db 608 | db_result = run_result.split('\n') 609 | for row from 1 to db_result.length 610 | { 611 | db_row = db_result[row-1].split('\t') 612 | echo db_row[0] ',' db_row[1] 613 | } 614 | 615 | // form sql query to write to database and save to os script 616 | // on mac/linux be sure that read_db file has execute permission 617 | sql_query = 'mysql DATABASE_NAME -e "UPDATE TABLE_NAME SET NAME=\'KS\' WHERE EMAIL=\'kensoh@gmail.com\'"' 618 | dump sql_query to write_db 619 | 620 | // above assumes running as root user from server, if database credentials are required, use below - 621 | // sql_query = 'mysql DATABASE_NAME --user=username --password=\'password\' -e "SELECT NAME,EMAIL FROM TABLE_NAME"' 622 | 623 | // use run step to run the script to write 624 | run /full_path_to_flow/write_db 625 | 626 | // repeat the reading of database showing new data 627 | run /full_path_to_flow/read_db 628 | db_result = run_result.split('\n') 629 | for row from 1 to db_result.length 630 | { 631 | db_row = db_result[row-1].split('\t') 632 | echo db_row[0] ',' db_row[1] 633 | } 634 | ) 635 | Gosub Paste_and_Restore_Stored_Clipboard 636 | return 637 | 638 | 639 | WebScraping_dropdownitem: 640 | Store:=ClipboardAll ;****Store clipboard **** 641 | Clipboard= 642 | ( Join`r`n 643 | //return number of items in Select dropdown 644 | dom return document.getElementById("BSDATORE").options.length; 645 | echo dom_result 646 | ) 647 | Gosub Paste_and_Restore_Stored_Clipboard 648 | return 649 | 650 | WebScraping_array: 651 | Store:=ClipboardAll ;****Store clipboard **** 652 | Clipboard= 653 | ( Join`r`n 654 | //array declaration 655 | cars = ["Saab", "Volvo", "BMW"]; 656 | //loop for with some element substitution 657 | for i from 0 to 2 658 | { 659 | //using array variable with special marks in some action 660 | echo 'array '+i+' is :'+cars[i] 661 | } 662 | ) 663 | Gosub Paste_and_Restore_Stored_Clipboard 664 | return 665 | 666 | 667 | 668 | WebScraping_dates: 669 | Store:=ClipboardAll ;****Store clipboard **** 670 | Clipboard= 671 | ( Join`r`n 672 | //return date informations 673 | dateObj = new Date(); 674 | month = dateObj.getUTCMonth() + 1; 675 | day = dateObj.getUTCDate(); 676 | year = dateObj.getUTCFullYear(); 677 | 678 | echo 'month :'+month 679 | echo 'day :'+day 680 | ) 681 | Gosub Paste_and_Restore_Stored_Clipboard 682 | return 683 | 684 | 685 | WebScraping_random: 686 | Store:=ClipboardAll ;****Store clipboard **** 687 | Clipboard= 688 | ( Join`r`n 689 | //array declaration 690 | cars = ["Saab", "Volvo", "BMW", "Ferrari", "Peugeot", "Fiat"]; 691 | 692 | //If you wanted to get between 0 and 5 693 | random=Math.floor(Math.random() * 5) + 0; 694 | 695 | echo 'random is : '+random 696 | echo 'array '+random+' is : '+cars[random] 697 | ) 698 | Gosub Paste_and_Restore_Stored_Clipboard 699 | return 700 | 701 | WebScraping_if: 702 | Store:=ClipboardAll ;****Store clipboard **** 703 | Clipboard= 704 | ( Join`r`n 705 | //conditions examples (natural language) 706 | if day equals to "Friday" 707 | if menu contains "fruits" 708 | if A more than B and C not equals to D 709 | ) 710 | Gosub Paste_and_Restore_Stored_Clipboard 711 | return 712 | 713 | WebScraping_R: 714 | Store:=ClipboardAll ;****Store clipboard **** 715 | Clipboard= 716 | ( Join`r`n 717 | // you can use r begin and r finish to denote a R code block 718 | r begin 719 | a=1;b=2 720 | c=a+b 721 | cat(c) 722 | r finish 723 | echo r_result 724 | // alternatively,launch R script like this 725 | r begin 726 | source("/Users/kensoh/Desktop/sampler2.r") 727 | r finish 728 | ) 729 | Gosub Paste_and_Restore_Stored_Clipboard 730 | return 731 | 732 | 733 | WebScraping_for: 734 | Store:=ClipboardAll ;****Store clipboard **** 735 | Clipboard= 736 | ( Join`r`n 737 | //loop for with some element substitution 738 | for i from 1 to 3 739 | { 740 | element_symb = 'ul > li:nth-child(INDEX) .cell-market-name_name' 741 | element_size = 'ul > li:nth-child(INDEX) .cell-size' 742 | element_symb = element_symb.replace("INDEX", i); 743 | element_size = element_size.replace("INDEX", i); 744 | 745 | if present(element_symb) 746 | { 747 | read '+element_symb+' to symb 748 | read '+element_size+' to size 749 | echo 'result : ' + symb + ' : ' + size 750 | } 751 | } 752 | ) 753 | Gosub Paste_and_Restore_Stored_Clipboard 754 | return 755 | 756 | WebScraping_checkmybox: 757 | Store:=ClipboardAll ;****Store clipboard **** 758 | Clipboard= 759 | ( Join`r`n 760 | // Check checkbox 761 | dom document.forms[0].settimaneRetribuzioneSelezionate[0].checked = true; 762 | ) 763 | Gosub Paste_and_Restore_Stored_Clipboard 764 | return 765 | 766 | WebScraping_indexof: 767 | Store:=ClipboardAll ;****Store clipboard **** 768 | Clipboard= 769 | ( Join`r`n 770 | //return 1st position of string in other string 771 | str = "Hello world"; 772 | position = str.indexOf("e"); 773 | // string.indexOf(searchvalue, start) 774 | echo "position= " + position 775 | ) 776 | Gosub Paste_and_Restore_Stored_Clipboard 777 | return 778 | 779 | 780 | WebScraping_case: 781 | Store:=ClipboardAll ;****Store clipboard **** 782 | Clipboard= 783 | ( Join`r`n 784 | //convert Lowercase/uppercase 785 | myString = myString.toLowerCase(); 786 | myString = myString.toUpperCase(); 787 | ) 788 | Gosub Paste_and_Restore_Stored_Clipboard 789 | return 790 | 791 | 792 | WebScraping_substring: 793 | Store:=ClipboardAll ;****Store clipboard **** 794 | Clipboard= 795 | ( Join`r`n 796 | //extract some characters from a string 797 | str = "Hello world!"; 798 | res = str.substring(1, 4); 799 | echo "res= " + res 800 | ) 801 | Gosub Paste_and_Restore_Stored_Clipboard 802 | return 803 | 804 | 805 | WebScraping_substitute: 806 | Store:=ClipboardAll ;****Store clipboard **** 807 | Clipboard= 808 | ( Join`r`n 809 | //substitute comma by dot 810 | str='5,17' 811 | newstr=str.replace(',', '.'); 812 | echo "newstr= " + newstr 813 | ) 814 | Gosub Paste_and_Restore_Stored_Clipboard 815 | return 816 | 817 | WebScraping_atribute: 818 | Store:=ClipboardAll ;****Store clipboard **** 819 | Clipboard= 820 | ( Join`r`n 821 | //Getting href (or other attributes) of web element 822 | element_identifier = '#c_16 > div:nth-child(1) > h3 > a' 823 | myurl = this.getElementsAttribute(element_identifier, 'href') 824 | echo myurl 825 | ) 826 | Gosub Paste_and_Restore_Stored_Clipboard 827 | return 828 | 829 | 830 | WebScraping_checkbox: 831 | Store:=ClipboardAll ;****Store clipboard **** 832 | Clipboard= 833 | ( Join`r`n 834 | //return if a checkbox is checked, example: 835 | http://echoecho.com/htmlforms09.htm 836 | dom return document.querySelector('input[type="checkbox"]:nth-child(2)').checked 837 | if dom_result equals to true 838 | variable=1 839 | else 840 | variable=0 841 | echo 'variable: '+variable 842 | ) 843 | Gosub Paste_and_Restore_Stored_Clipboard 844 | return 845 | 846 | 847 | WebScraping_proxy: 848 | Store:=ClipboardAll ;****Store clipboard **** 849 | Clipboard= 850 | ( Join`r`n 851 | //accessing the next URL under that proxy. 852 | //The last 2 parameters are the username and password, if your proxy service provider requires credentials. 853 | phantom.setProxy('IP', 'port', 'manual', '', ''); 854 | https://www.google.com/ 855 | ) 856 | Gosub Paste_and_Restore_Stored_Clipboard 857 | return 858 | 859 | WebScraping_popup: 860 | Store:=ClipboardAll ;****Store clipboard **** 861 | Clipboard= 862 | ( Join`r`n 863 | http://tebel.org/index_mobile.php 864 | // click ABOUT footer to open a new tab window 865 | click ABOUT 866 | // the execution context is still at the original window 867 | // in order to interact with the new tab window use popup step 868 | // the popup step looks for a keyword in the urls within the 869 | // list of tabs that you have opened in this session of tagui 870 | // after the next step, context returns to original window 871 | popup about_tebel 872 | { 873 | print file-about_tebel-LC2 874 | snap file-about_tebel-LC2 875 | } 876 | ) 877 | Gosub Paste_and_Restore_Stored_Clipboard 878 | return 879 | 880 | 881 | WebScraping_frame: 882 | Store:=ClipboardAll ;****Store clipboard **** 883 | Clipboard= 884 | ( Join`r`n 885 | // for frame step it is used to access webpage implemented as a frame within another webpage 886 | // the usage is similar to popup step, except that the parameter is the frame name 887 | // if there is a subframe within the mainframe, use frame mainframe | subframe 888 | frame framename 889 | { 890 | ***do something*** 891 | } 892 | ) 893 | Gosub Paste_and_Restore_Stored_Clipboard 894 | return 895 | 896 | 897 | WebScraping_tableelements: 898 | Store:=ClipboardAll ;****Store clipboard **** 899 | Clipboard= 900 | ( Join`r`n 901 | // go to another web page with a table to practice for loop 902 | https://github.com/tebelorg/TLE 903 | // for loop can be expressed in natural language or JavaScript 904 | for column from 1 to 6 905 | { 906 | // '+variable_name+' can be used where text is expected 907 | show (//table)[3]//td['+column+'] 908 | } 909 | ) 910 | Gosub Paste_and_Restore_Stored_Clipboard 911 | return 912 | 913 | 914 | WebScraping_webtext: 915 | Store:=ClipboardAll ;****Store clipboard **** 916 | Clipboard= 917 | ( Join`r`n 918 | //return text in command 919 | echo 'text: ' text() 920 | ) 921 | Gosub Paste_and_Restore_Stored_Clipboard 922 | return 923 | 924 | WebScraping_OCR: 925 | Store:=ClipboardAll ;****Store clipboard **** 926 | Clipboard= 927 | ( Join`r`n 928 | //https://github.com/kelaberetiv/TagUI/issues/269 929 | 930 | vision ocr_text = Region(760, 460, 440, 60).text() 931 | vision tagui_text = open('tagui.sikuli/tagui_sikuli.txt','w') 932 | vision tagui_text.write(ocr_text); tagui_text.close() 933 | vision_result = fetch_sikuli_text() 934 | echo vision_result 935 | ) 936 | Gosub Paste_and_Restore_Stored_Clipboard 937 | return 938 | 939 | 940 | WebScraping_url: 941 | Store:=ClipboardAll ;****Store clipboard **** 942 | Clipboard= 943 | ( Join`r`n 944 | //return url in command 945 | echo 'page url: ' url() 946 | //you can use also: 947 | echo 'UPLOADED URL - ' this.getCurrentUrl() + '\n' 948 | //append url in file 949 | write url() to urllist.txt 950 | ) 951 | Gosub Paste_and_Restore_Stored_Clipboard 952 | return 953 | 954 | 955 | WebScraping_text: 956 | Store:=ClipboardAll ;****Store clipboard **** 957 | Clipboard= 958 | ( Join`r`n 959 | //check before if page contain text 960 | check text() contains "Click here" | "page text contains this text" | "page text does NOT contain this text" 961 | //click on text 962 | click //*[text()="Click here"] 963 | //click on text contained in variable 964 | click //*[text()="'+variable+'"] 965 | ) 966 | Gosub Paste_and_Restore_Stored_Clipboard 967 | return 968 | 969 | 970 | WebScraping_checkelement: 971 | Store:=ClipboardAll ;****Store clipboard **** 972 | Clipboard= 973 | ( Join`r`n 974 | //check if page contain element 975 | if present('element_identifier') 976 | { 977 | fetch element_identifier to element_info 978 | echo element_info 979 | } 980 | //check if element is visible 981 | if visible('element_identifier') 982 | { 983 | fetch element_identifier to element_info 984 | echo element_info 985 | } 986 | ) 987 | Gosub Paste_and_Restore_Stored_Clipboard 988 | return 989 | 990 | 991 | 992 | WebScraping_checktext: 993 | Store:=ClipboardAll ;****Store clipboard **** 994 | Clipboard= 995 | ( Join`r`n 996 | //check if page contain text 997 | check text() contains "text" | "page text contains text" | "page text does not contain text" 998 | //Other way : if string variable is found make some action 999 | stringvariable='my text'; 1000 | if present('//*[text()="'+stringvariable+'"]') 1001 | { 1002 | echo stringvariable + ' is present' 1003 | } 1004 | ) 1005 | Gosub Paste_and_Restore_Stored_Clipboard 1006 | return 1007 | 1008 | WebScraping_timer: 1009 | Store:=ClipboardAll ;****Store clipboard **** 1010 | Clipboard= 1011 | ( Join`r`n 1012 | // use timer() as a stopwatch to track elapsed time between calls 1013 | start = timer() 1014 | 1015 | // ... some actions... 1016 | 1017 | // use timer() as a stopwatch to track elapsed time between calls 1018 | time_taken = timer() 1019 | echo 'time taken - ' time_taken ' seconds' 1020 | ) 1021 | Gosub Paste_and_Restore_Stored_Clipboard 1022 | return 1023 | 1024 | 1025 | WebScraping_countel: 1026 | Store:=ClipboardAll ;****Store clipboard **** 1027 | Clipboard= 1028 | ( Join`r`n 1029 | //specify same id, class name of all elements on the page... 1030 | count_number = count('uh-tb-') 1031 | echo 'count_number = ' count_number 1032 | ) 1033 | Gosub Paste_and_Restore_Stored_Clipboard 1034 | return 1035 | 1036 | WebScraping_present: 1037 | Store:=ClipboardAll ;****Store clipboard **** 1038 | Clipboard= 1039 | ( Join`r`n 1040 | if present('Selector') 1041 | { 1042 | //STUFF// 1043 | } 1044 | ) 1045 | Gosub Paste_and_Restore_Stored_Clipboard 1046 | return 1047 | 1048 | WebScraping_ifcontain: 1049 | Store:=ClipboardAll ;****Store clipboard **** 1050 | Clipboard:="if ****text variable(without quotation marks)*** contains 'text (with quotation marks)' " 1051 | Gosub Paste_and_Restore_Stored_Clipboard 1052 | return 1053 | 1054 | WebScraping_checkpres: 1055 | Store:=ClipboardAll ;****Store clipboard **** 1056 | Clipboard:="check present('search-buttons') | 'search button exists' | 'search button does not exist' " 1057 | Gosub Paste_and_Restore_Stored_Clipboard 1058 | return 1059 | 1060 | WebScraping_checkcount: 1061 | Store:=ClipboardAll ;****Store clipboard **** 1062 | Clipboard:="check count('uh-tb-') more than or equals to 6|'header menu items >= 6'|'header menu items < 6' " 1063 | Gosub Paste_and_Restore_Stored_Clipboard 1064 | return 1065 | 1066 | 1067 | 1068 | WebScraping_domloop: 1069 | Store:=ClipboardAll ;****Store clipboard **** 1070 | Clipboard= 1071 | ( Join`r`n 1072 | // JavaScript can be used directly in the flow for more expressive and advanced automation 1073 | // default execution context for JavaScript is local, to work on webpage dom, use dom step 1074 | // following loop through directly in webpage dom to compile and return list of profile ids 1075 | dom id_list = ""; for (n=1;n<=51;n++) {id_list += document.querySelector('.follow-list-item:nth-child('+n+') a').href + '\n'}; return id_list; 1076 | echo dom_result 1077 | // you can also use JavaScript to do post-processing and write to a file, or to a format directly usable by flow 6B 1078 | var fs = require('fs'); fs.write("/tmp/urls.csv", dom_result + "\n", 'w'); 1079 | ) 1080 | Gosub Paste_and_Restore_Stored_Clipboard 1081 | return 1082 | 1083 | WebScraping_domsave: 1084 | Store:=ClipboardAll ;****Store clipboard **** 1085 | Clipboard= 1086 | ( Join`r`n 1087 | // you can also use JavaScript to do post-processing and write to a file, or to a format directly usable by flow 6B 1088 | var fs = require('fs'); fs.write("/tmp/urls.csv", dom_result + "\n", 'w'); 1089 | ) 1090 | Gosub Paste_and_Restore_Stored_Clipboard 1091 | return 1092 | 1093 | WebScraping_receive: 1094 | Store:=ClipboardAll ;****Store clipboard **** 1095 | Clipboard:="receive ***url keyword*** to ***filename*** " 1096 | Gosub Paste_and_Restore_Stored_Clipboard 1097 | return 1098 | 1099 | WebScraping_download: 1100 | Store:=ClipboardAll ;****Store clipboard **** 1101 | Clipboard:="download ***url*** to ***filename*** " 1102 | Gosub Paste_and_Restore_Stored_Clipboard 1103 | return 1104 | 1105 | 1106 | WebScraping_upload: 1107 | Store:=ClipboardAll ;****Store clipboard **** 1108 | Clipboard:="upload ***element*** as ***filename*** //note: CSS selector only " 1109 | Gosub Paste_and_Restore_Stored_Clipboard 1110 | return 1111 | 1112 | WebScraping_attribute: 1113 | Store:=ClipboardAll ;****Store clipboard **** 1114 | Clipboard:="js myurl = this.getElementsAttribute(element_identifier, 'href');" 1115 | Gosub Paste_and_Restore_Stored_Clipboard 1116 | return 1117 | 1118 | WebScraping_wait: 1119 | Store:=ClipboardAll ;****Store clipboard **** 1120 | Clipboard:="wait ***time in seconds(optional)*** //note: default is 5 sec. " 1121 | Gosub Paste_and_Restore_Stored_Clipboard 1122 | return 1123 | 1124 | WebScraping_live: 1125 | Store:=ClipboardAll ;****Store clipboard **** 1126 | Clipboard:="live ***try steps or code interactively in Chrome / PhantomJS*** //note: Firefox not yet " 1127 | Gosub Paste_and_Restore_Stored_Clipboard 1128 | return 1129 | 1130 | WebScraping_check: 1131 | Store:=ClipboardAll ;****Store clipboard **** 1132 | Clipboard:="check ***condition*** | 'text if true' | 'text if false' //note: text in quotes " 1133 | Gosub Paste_and_Restore_Stored_Clipboard 1134 | return 1135 | 1136 | 1137 | WebScraping_run: 1138 | Store:=ClipboardAll ;****Store clipboard **** 1139 | Clipboard= 1140 | ( Join`r`n 1141 | tagui ***filename*** options(s) 1142 | //OPTION LIST: 1143 | //headless run on invisible Chrome web browser instead of default PhantomJS (first install Chrome) 1144 | //chrome run on visible Chrome web browser instead of invisible PhantomJS (first install Chrome) 1145 | //firefox run on visible Firefox web browser instead of invisible browser (first install Firefox) 1146 | //upload upload automation flow and result to hastebin.com (expires 30 days after last view) 1147 | //report web report for sharing of run results on webserver (default is only a text log file) 1148 | //debug show run-time backend messages from PhantomJS for detailed tracing and logging 1149 | //quiet run without output except for explicit output (echo / show / check / errors etc) 1150 | //speed skip 3-second delay between datatable iterations (and skip restarting of Chrome) 1151 | //test testing with check step test assertions for CI/CD integration (output XUnit XML file) 1152 | //baseline output execution log and relative-path output files to a separate baseline directory 1153 | //input(s) add your own parameter(s) to be used in your automation flow as variables p1 to p9 1154 | //i.e. Command Line: tagui demo chrome apple orange banana 1155 | //i.e. Script get inputs: 1156 | //echo "parameter 1 is - " p1 1157 | //echo "parameter 2 is - " p2 1158 | //echo "parameter 3 is - " p3 1159 | ) 1160 | Gosub Paste_and_Restore_Stored_Clipboard 1161 | return 1162 | 1163 | WebScraping_table: 1164 | Store:=ClipboardAll ;****Store clipboard **** 1165 | Clipboard:="table ***element*** to optional filename.csv ***filename.csv (optional)*** //note: XPath selector only " 1166 | Gosub Paste_and_Restore_Stored_Clipboard 1167 | return 1168 | 1169 | 1170 | WebScraping_snap_pdf: 1171 | Store:=ClipboardAll ;****Store clipboard **** 1172 | Clipboard:="snap page to ***filename.pdf*** //note: headless Chrome / PhantomJS " 1173 | Gosub Paste_and_Restore_Stored_Clipboard 1174 | return 1175 | 1176 | 1177 | WebScraping_snap: 1178 | Store:=ClipboardAll ;****Store clipboard **** 1179 | Clipboard= 1180 | ( Join`r`n 1181 | //note: you can snap element or entire page 1182 | snap page to myscript.png 1183 | ) 1184 | Gosub Paste_and_Restore_Stored_Clipboard 1185 | return 1186 | 1187 | WebScraping_snappage: 1188 | Store:=ClipboardAll ;****Store clipboard **** 1189 | Clipboard:="snap page" 1190 | Gosub Paste_and_Restore_Stored_Clipboard 1191 | return 1192 | 1193 | 1194 | go_to_url: 1195 | Store:=ClipboardAll ;****Store clipboard **** 1196 | Clipboard= 1197 | ( Join`r`n 1198 | // just enter full url of webpage ('+variable+' for variable) 1199 | https://www.webpage.com/ 1200 | ) 1201 | Gosub Paste_and_Restore_Stored_Clipboard 1202 | return 1203 | 1204 | WebScraping_Click: 1205 | Store:=ClipboardAll ;****Store clipboard **** 1206 | Clipboard:="click ***element*** //i.e. using variable: click '+element_identifier+' " 1207 | Gosub Paste_and_Restore_Stored_Clipboard 1208 | return 1209 | 1210 | 1211 | WebScraping_image: 1212 | Store:=ClipboardAll ;****Store clipboard **** 1213 | Clipboard= 1214 | ( Join`r`n 1215 | //click on specific image file (use Screenshoter tool) 1216 | click C:\TagUI\filename.png 1217 | ) 1218 | Gosub Paste_and_Restore_Stored_Clipboard 1219 | return 1220 | 1221 | WebScraping_mouse: 1222 | Store:=ClipboardAll ;****Store clipboard **** 1223 | Clipboard= 1224 | ( Join`r`n 1225 | //click on current mouse position using Sikuli 1226 | //left click 1227 | vision click(atMouse()) 1228 | 1229 | //right click 1230 | vision rightClick(atMouse()) 1231 | 1232 | //double click 1233 | vision doubleClick(atMouse()) 1234 | ) 1235 | Gosub Paste_and_Restore_Stored_Clipboard 1236 | return 1237 | 1238 | 1239 | Store:=ClipboardAll ;****Store clipboard **** 1240 | Clipboard:="click C:/myimage.png " 1241 | Gosub Paste_and_Restore_Stored_Clipboard 1242 | return 1243 | 1244 | 1245 | WebScraping_Click_Focus: 1246 | Store:=ClipboardAll ;****Store clipboard **** 1247 | Clipboard:="hover '***element***' " 1248 | Gosub Paste_and_Restore_Stored_Clipboard 1249 | return 1250 | 1251 | 1252 | WebScraping_enter: 1253 | Store:=ClipboardAll ;****Store clipboard **** 1254 | Clipboard= 1255 | ( Join`r`n 1256 | //entering text replicating user actions when typing the text character by character 1257 | enter ***element*** as my text 1258 | //entering variable without quotation marks 1259 | enter ***element*** as variable 1260 | //entering array variable with special marks 1261 | enter ***element*** as '+array[1]+' 1262 | //To set the value directly of HTML element, you can use dom step: 1263 | dom_json = 'long string of text' 1264 | dom document.getElementById('uh-search-box').value = dom_json 1265 | ) 1266 | Gosub Paste_and_Restore_Stored_Clipboard 1267 | return 1268 | 1269 | 1270 | 1271 | WebScraping_csv: 1272 | Store:=ClipboardAll ;****Store clipboard **** 1273 | Clipboard= 1274 | ( Join`r`n 1275 | // write the information received into a csv spreadsheet file 1276 | // set file to appropriate location, especially if using Windows 1277 | var fs = require('fs'); fs.write("/tmp/contacts.csv", "\""+fullname+"\",\""+username+"\",\""+email+"\",\""+url+"\",\""+country+"\",\""+bio+"\"\n", 'a'); 1278 | ) 1279 | Gosub Paste_and_Restore_Stored_Clipboard 1280 | return 1281 | 1282 | 1283 | 1284 | WebScraping_content: 1285 | Store:=ClipboardAll ;****Store clipboard **** 1286 | Clipboard= 1287 | ( Join`r`n 1288 | //email to check/append 1289 | email="pinco1@gmail.com"; 1290 | 1291 | //path of file to create/use 1292 | //this file must exist: 1293 | path="/tmp/myfile.csv"; 1294 | 1295 | fs = require('fs');if (!fs.exists(path)) fs.write(path, 'Mailing list \n', 'w'); 1296 | 1297 | load '+path+' to database_emails 1298 | echo 'database_emails: '+database_emails 1299 | 1300 | if (database_emails.indexOf(email)>-1) 1301 | { 1302 | echo 'email already exist in database' 1303 | } 1304 | else 1305 | { 1306 | echo 'email added in database' 1307 | write email to '+path+' 1308 | } 1309 | ) 1310 | Gosub Paste_and_Restore_Stored_Clipboard 1311 | return 1312 | 1313 | 1314 | 1315 | WebScraping_enterrepo: 1316 | Store:=ClipboardAll ;****Store clipboard **** 1317 | Clipboard= 1318 | ( Join`r`n 1319 | // contents of datatable.csv 1320 | // DATA,#1,#2,#3 1321 | // GITHUB_ID,ironman,batman,superman 1322 | // USER_EMAIL,tony@stark.org,bruce@wayne.org,clarke@kent.org 1323 | 1324 | enter ***element*** as "```GITHUB_ID```" 1325 | ) 1326 | Gosub Paste_and_Restore_Stored_Clipboard 1327 | return 1328 | 1329 | WebScraping_pressenter: 1330 | Store:=ClipboardAll ;****Store clipboard **** 1331 | Clipboard:="enter ***element*** as [enter] " 1332 | Gosub Paste_and_Restore_Stored_Clipboard 1333 | return 1334 | 1335 | WebScraping_option: 1336 | Store:=ClipboardAll ;****Store clipboard **** 1337 | Clipboard:="select ***element*** as ***option value*** //note: [clear] = clear selection " 1338 | Gosub Paste_and_Restore_Stored_Clipboard 1339 | return 1340 | 1341 | WebScraping_read: 1342 | Store:=ClipboardAll ;****Store clipboard **** 1343 | Clipboard:="read ***element*** to ***variable name*** " 1344 | Gosub Paste_and_Restore_Stored_Clipboard 1345 | return 1346 | 1347 | WebScraping_echo: 1348 | Store:=ClipboardAll ;****Store clipboard **** 1349 | Clipboard:="echo ***text (in quotation marks)*** and variables (without quotation)" 1350 | Gosub Paste_and_Restore_Stored_Clipboard 1351 | return 1352 | 1353 | WebScraping_print: 1354 | Store:=ClipboardAll ;****Store clipboard **** 1355 | Clipboard:="print ***element*** " 1356 | Gosub Paste_and_Restore_Stored_Clipboard 1357 | return 1358 | 1359 | WebScraping_save: 1360 | Store:=ClipboardAll ;****Store clipboard **** 1361 | Clipboard:="save ***element*** to ***filename(optional)***" 1362 | Gosub Paste_and_Restore_Stored_Clipboard 1363 | return 1364 | 1365 | WebScraping_dump: 1366 | Store:=ClipboardAll ;****Store clipboard **** 1367 | Clipboard:="dump ***text and variables*** to ***filename***" 1368 | Gosub Paste_and_Restore_Stored_Clipboard 1369 | return 1370 | 1371 | WebScraping_append: 1372 | Store:=ClipboardAll ;****Store clipboard **** 1373 | Clipboard:="write ***text and variables*** to ***filename***" 1374 | Gosub Paste_and_Restore_Stored_Clipboard 1375 | return 1376 | 1377 | WebScraping_load: 1378 | Store:=ClipboardAll ;****Store clipboard **** 1379 | Clipboard:="load ***filename*** to ***variable name***" 1380 | Gosub Paste_and_Restore_Stored_Clipboard 1381 | return 1382 | 1383 | 1384 | ;****************************** 1385 | ;***********Subroutines******************* 1386 | ;****************************** 1387 | ;*******Store Clipboard- **************** 1388 | Store_Clipboard_Copy_Selected_Text: 1389 | Store:=ClipboardAll ;Store full version of Clipboard 1390 | clipboard :="" ; Empty the clipboard 1391 | Send, ^c ;Depending on your OS and Admin level- you might want to check this 1392 | ClipWait, 1 1393 | return 1394 | 1395 | ;***********Restore clipboard******************* 1396 | Paste_and_Restore_Stored_Clipboard: ;~ MsgBox % clipboard 1397 | Sleep, 50 1398 | Send, ^v ;Depending on your OS and Admin level- you might want to check this 1399 | Sleep, 50 1400 | Clipboard:=Store ;Restore clipboard to original contents 1401 | return 1402 | -------------------------------------------------------------------------------- /TagUI_Editor.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adegard/tagui_scripts/0ede452b768600041469899ef3ccef76583f1474/TagUI_Editor.exe -------------------------------------------------------------------------------- /TagUI_Editor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adegard/tagui_scripts/0ede452b768600041469899ef3ccef76583f1474/TagUI_Editor.gif -------------------------------------------------------------------------------- /Tagui-Writer1.03.ahk: -------------------------------------------------------------------------------- 1 | #Persistent 2 | #SingleInstance Force 3 | #NoEnv 4 | Menu, tray, icon, %A_WinDir%\system32\shell32.dll, 264 5 | ;***********************tray items********************************. 6 | Menu, Tray, NoStandard ;removes default options 7 | Menu, Tray, Add, Helpful Links, Helpful_Links 8 | Menu, Tray, Add, About this program, About 9 | Menu, Tray, Add, 10 | Menu, Tray, Add, Reload 11 | Menu, Tray, Add, Edit 12 | Menu, Tray, Add, Exit 13 | ;****************************** 14 | 15 | 16 | 17 | 18 | ;~ https://diymediahome.org/windows-icons-reference-list-with-details-locations-images/ 19 | ;****************************** 20 | ;***********Navigate Webpage******************* 21 | ;****************************** 22 | Menu,WebScraping_Pointer,Add,Go to specified webpage, go_to_url 23 | Menu,WebScraping_Pointer,Icon,Go to specified webpage, %A_windir%\system32\shell32.dll,18 24 | Menu,Webscraping, Add, Webpage, :WebScraping_Pointer 25 | Menu,Webscraping,Icon,Webpage, %A_WinDir%\system32\SHELL32.dll, 18 ; %A_WinDir%\system32\imageres.dll, 18 26 | 27 | ;****************************** 28 | ;***********Click******************* 29 | ;****************************** 30 | Menu,WebScraping_Click,Add,Click on Element, WebScraping_Click 31 | Menu,WebScraping_Click,Icon,Click on Element, %A_windir%\system32\shell32.dll,100 32 | Menu,WebScraping_Click,Add,Click on image, WebScraping_image 33 | Menu,WebScraping_Click,Icon,Click on image, %A_windir%\system32\shell32.dll,100 34 | Menu,WebScraping_Click,Add,Click on current mouse position, WebScraping_mouse 35 | Menu,WebScraping_Click,Icon,Click on current mouse position, %A_windir%\system32\shell32.dll,100 36 | Menu,WebScraping_Click,Add,Click on Text, WebScraping_text 37 | Menu,WebScraping_Click,Icon,Click on Text, %A_windir%\system32\shell32.dll,75 38 | Menu,WebScraping_Click,Add,move cursor to element,WebScraping_Click_Focus 39 | Menu,WebScraping_Click,Icon,move cursor to element, %A_windir%\system32\shell32.dll,101 40 | 41 | Menu,WebScraping,Add,Click, :WebScraping_Click ;*********** ******************* 42 | Menu,WebScraping,Icon,Click, %A_WinDir%\system32\mmcndmgr.dll,51 43 | 44 | ;*************Set***************** 45 | Menu,WebScraping_set,Add,Enter text or variables or arrays, WebScraping_enter 46 | Menu,WebScraping_set,Add,Enter value from repository, WebScraping_enterrepo 47 | Menu,WebScraping_set,Add,Check a Checkbox, WebScraping_checkmybox 48 | Menu,WebScraping_set,Icon,Check a Checkbox, %A_windir%\system32\shell32.dll,217 49 | Menu,WebScraping_set,Add,Choose dropdown option, WebScraping_option 50 | Menu,WebScraping_set,Add,Press Enter key in element, WebScraping_pressenter 51 | 52 | Menu,WebScraping,Add,Set, :WebScraping_set ;*********** ******************* 53 | Menu,WebScraping,Icon,Set, %A_WinDir%\system32\shell32.dll,166 54 | 55 | 56 | ;*************Scrap***************** 57 | Menu,WebScraping_get,Add,Check text presence, WebScraping_checktext 58 | Menu,WebScraping_get,Icon,Check text presence, %A_windir%\system32\shell32.dll,219 59 | Menu,WebScraping_get,Add,Check element presence visible, WebScraping_checkelement 60 | Menu,WebScraping_get,Icon,Check element presence visible, %A_windir%\system32\shell32.dll,219 61 | Menu,WebScraping_get,Add,Return if checkbox is checked, WebScraping_checkbox 62 | Menu,WebScraping_get,Icon,Return if checkbox is checked, %A_windir%\system32\shell32.dll,217 63 | Menu,WebScraping_get,Add,Count items in dropdown select, WebScraping_dropdownitem 64 | Menu,WebScraping_get,Add,Getting attribute (like href) of elements, WebScraping_atribute 65 | Menu,WebScraping_get,Add,Read element text to variable, WebScraping_read 66 | Menu,WebScraping_get,Add,Print element text to output, WebScraping_print 67 | Menu,WebScraping_get,Add,Echo text/variables to output, WebScraping_echo 68 | Menu,WebScraping_get,Add,Echo url of webpage, WebScraping_url 69 | Menu,WebScraping_get,Icon,Echo url of webpage, %A_windir%\system32\shell32.dll,18 70 | Menu,WebScraping_get,Add,Echo text of webpage, WebScraping_webtext 71 | Menu,WebScraping_get,Icon,Echo text of webpage, %A_windir%\system32\shell32.dll,18 72 | Menu,WebScraping_get,Add,Save screenshot to file, WebScraping_snap 73 | Menu,WebScraping_get,Icon,Save screenshot to file, %A_windir%\system32\shell32.dll,140 74 | Menu,WebScraping_get,Add,Snap page, WebScraping_snappage 75 | Menu,WebScraping_get,Icon,Snap page, %A_windir%\system32\shell32.dll,140 76 | Menu,WebScraping_get,Add,Save webpage to pdf, WebScraping_snap_pdf 77 | Menu,WebScraping_get,Icon,Save webpage to pdf, %A_windir%\system32\shell32.dll,76 78 | Menu,WebScraping_get,Add,Save basic html table to csv, WebScraping_table 79 | Menu,WebScraping_get,Icon,Save basic html table to csv, %A_windir%\system32\shell32.dll,115 80 | Menu,WebScraping_get,Add,Count elements on page, WebScraping_countel 81 | Menu,WebScraping_get,Icon,Count elements on page, %A_windir%\system32\shell32.dll,166 82 | Menu,WebScraping_get,Add,Scrap elements of table (loop), WebScraping_tableelements 83 | Menu,WebScraping_get,Icon,Scrap elements of table (loop), %A_windir%\system32\shell32.dll,166 84 | Menu,WebScraping_get,Add,Track time between events, WebScraping_timer 85 | Menu,WebScraping_get,Icon,Track time between events, %A_windir%\system32\shell32.dll,240 86 | 87 | Menu,WebScraping,Add,Scrap, :WebScraping_get ;*********** ******************* 88 | Menu,WebScraping,Icon,Scrap, %A_WinDir%\system32\shell32.dll,219 89 | 90 | ;*************File***************** 91 | Menu,WebScraping_file,Add,Save element text to file, WebScraping_save 92 | Menu,WebScraping_file,Add,Save text/variables to file, WebScraping_dump 93 | Menu,WebScraping_file,Add,Save informations to a csv file, WebScraping_csv 94 | Menu,WebScraping_file,Icon,Save informations to a csv file, %A_windir%\system32\shell32.dll,115 95 | Menu,WebScraping_file,Add,Append text/variables to file, WebScraping_append 96 | Menu,WebScraping_file,Add,Load file content to variable, WebScraping_load 97 | Menu,WebScraping_file,Add,COMPLETE EXAMPLE Search/Append content in File, WebScraping_content 98 | Menu,WebScraping_file,Add,upload file to website, WebScraping_upload 99 | Menu,WebScraping_file,Icon,upload file to website, %A_windir%\system32\shell32.dll,264 100 | Menu,WebScraping_file,Add,download from url to file, WebScraping_download 101 | Menu,WebScraping_file,Icon,download from url to file, %A_windir%\system32\shell32.dll,123 102 | Menu,WebScraping_file,Add,receive resource to file, WebScraping_receive 103 | 104 | 105 | Menu,WebScraping,Add,Save-Read File, :WebScraping_file ;*********** ******************* 106 | Menu,WebScraping,Icon,Save-Read File, %A_WinDir%\system32\shell32.dll,71 107 | 108 | 109 | ;*************Databases***************** 110 | Menu,WebScraping_db,Add,Take informations from repository, WebScraping_repo 111 | Menu,WebScraping_db,Icon,Take informations from repository, %A_windir%\system32\shell32.dll,55 112 | Menu,WebScraping_db,Add,Database example to crawl urls, WebScraping_db1 113 | Menu,WebScraping_db,Icon,Database example to crawl urls, %A_windir%\system32\shell32.dll,187 114 | Menu,WebScraping_db,Add,Database example for set of variables(arrays like), WebScraping_db2 115 | Menu,WebScraping_db,Icon,Database example for set of variables(arrays like), %A_windir%\system32\shell32.dll,187 116 | Menu,WebScraping_db,Add,MySQL Database access read and write, WebScraping_db3 117 | Menu,WebScraping_db,Icon,MySQL Database access read and write, %A_windir%\system32\shell32.dll,187 118 | 119 | Menu,WebScraping,Add,Databases/Repositories, :WebScraping_db ;*********** ******************* 120 | Menu,WebScraping,Icon,Databases/Repositories, %A_WinDir%\system32\shell32.dll,187 121 | 122 | 123 | 124 | 125 | 126 | 127 | ;*************Start***************** 128 | Menu,WebScraping_tagui,Add,Run tagui flow, WebScraping_run 129 | Menu,WebScraping_tagui,Icon,Run tagui flow, %A_windir%\system32\shell32.dll,215 130 | Menu,WebScraping,Add,Run script, :WebScraping_tagui ;*********** ******************* 131 | Menu,WebScraping,Icon,RUN script, %A_WinDir%\system32\shell32.dll,215 132 | 133 | ;*************Conditions***************** 134 | Menu,WebScraping_cond,Add,If text contain, WebScraping_ifcontain 135 | Menu,WebScraping_cond,Add,If value is more less, WebScraping_if 136 | Menu,WebScraping_cond,Add,If element present do action, WebScraping_present 137 | Menu,WebScraping_cond,Add,Check element present return text, WebScraping_checkpres 138 | Menu,WebScraping_cond,Add,Check number of elements return text, WebScraping_checkcount 139 | Menu,WebScraping_cond,Add,loop for, WebScraping_for 140 | Menu,WebScraping,Add,Conditions/loop, :WebScraping_cond ;*********** ******************* 141 | Menu,WebScraping,Icon,Conditions/loop, %A_WinDir%\system32\shell32.dll,145 142 | 143 | ;*************pro***************** 144 | Menu,WebScraping_pro,Add,wait for some time, WebScraping_wait 145 | Menu,WebScraping_pro,Add,enter live mode, WebScraping_live 146 | Menu,WebScraping_pro,Add,check condition and print result, WebScraping_check 147 | Menu,WebScraping_pro,Add,Access to frame in webpage, WebScraping_frame 148 | Menu,WebScraping_pro,Add,Access to second browser tab, WebScraping_popup 149 | Menu,WebScraping_pro,Add,Access under Proxy, WebScraping_proxy 150 | Menu,WebScraping_pro,Add,Integration with R, WebScraping_R 151 | 152 | 153 | Menu,WebScraping,Add,Pro steps, :WebScraping_pro ;*********** ******************* 154 | Menu,WebScraping,Icon,Pro steps, %A_WinDir%\system32\shell32.dll,72 155 | 156 | 157 | 158 | 159 | ;*************Javascript***************** 160 | Menu,WebScraping_js,Add,Find element attribute, WebScraping_attribute 161 | Menu,WebScraping_js,Add,Get list of element (dom), WebScraping_domloop 162 | Menu,WebScraping_js,Add,Save dom result in file, WebScraping_domsave 163 | Menu,WebScraping_js,Add,String replace (substitution of characters), WebScraping_substitute 164 | Menu,WebScraping_js,Add,String search (position of characters), WebScraping_indexof 165 | Menu,WebScraping_js,Add,String extraction (from a string), WebScraping_substring 166 | Menu,WebScraping_js,Add,Convert Lowercase/uppercase, WebScraping_case 167 | Menu,WebScraping_js,Add,Array declaration, WebScraping_array 168 | 169 | Menu,WebScraping,Add,Javascript, :WebScraping_js ;*********** ******************* 170 | Menu,WebScraping,Icon,Javascript, %A_WinDir%\system32\setupapi.dll,13 171 | 172 | 173 | ;****************************** 174 | ;***********Help******************* 175 | ;****************************** 176 | Menu,WebScraping,Add, ;***********spacer******************* 177 | Menu,WebScraping,Add, Helpful links, Helpful_Links 178 | Menu,WebScraping,Add, Exit App, Exit 179 | return 180 | 181 | ;****************************** 182 | ^Lbutton::Menu, WebScraping, Show ; right mouse and windows 183 | ;~ Browser_Forward::Reload 184 | ;****************************** 185 | 186 | 187 | 188 | 189 | WebScraping_repo: 190 | Store:=ClipboardAll ;****Store clipboard **** 191 | Clipboard= 192 | ( Join`r`n 193 | // repositories help to make objects or steps reusable and improve readability 194 | // save repository file with same name as your flow filename and with .csv behind 195 | // repository must have 2 columns, for example below (headers up to you to name) 196 | // using 'object' in your flow replaces it with its definition (which can contain objects) 197 | // for example during execution, 'click link' becomes click //*[@id="profile_full"]//a 198 | // if you have watched Inception movie, this is inception level 2 (capped at max 2 for now) 199 | // don't worry about mistakes, TagUI is usually able to tell you which line has what error 200 | 201 | // please note that in these precedent comments, the symbol ``` is replaced with ' 202 | // otherwise TagUI will try to interpret it as repository definition 203 | 204 | // contents of repository.csv 205 | // OBJECT,DEFINITION 206 | // email,quick_email 207 | // password,quick_pass 208 | // user_email,mickey_mouse@disney.com 209 | // user_password,iloveminnie4eva 210 | // show info,Show full information 211 | // click link,click ```facebook_link``` 212 | // facebook_link,//*[@id="profile_full"]//a 213 | 214 | // somes examples of use : 215 | enter ```email``` as ```user_email``` 216 | enter ```password``` as ```user_password``` 217 | click ```show info``` 218 | hover ```facebook_link``` 219 | wait 2.5 220 | ```click link``` 221 | wait 222 | ) 223 | Gosub Paste_and_Restore_Stored_Clipboard 224 | return 225 | 226 | 227 | WebScraping_db1: 228 | Store:=ClipboardAll ;****Store clipboard **** 229 | Clipboard= 230 | ( Join`r`n 231 | // datatables extend the power of repositories files to manage batch automation 232 | // datatable has 2 or more columns, for example below (headers up to you to name) 233 | // data-centric approach with rows representing data fields (usually row = test case) 234 | 235 | // Example : content of datatable.csv with the same name of tagui file 236 | // file in this format can be from flow 6A using JavaScript, or using Excel transpose function 237 | // 6B_GETCONTACT,#1,#2,#3 238 | // user_url,https://github.com/s0b0lev,https://github.com/zongUMR,https://github.com/jkmartindale 239 | 240 | ```user_url``` 241 | // TagUI loops through each column to automate using values from different datasets 242 | // for example, echo "URL - ```user_url```" in your flow shows URL - https://github.com/s0b0lev 243 | 244 | // read User Full Name and GitHub ID to variables 245 | read fullname to fullname 246 | read username to username 247 | echo fullname "," username 248 | ) 249 | Gosub Paste_and_Restore_Stored_Clipboard 250 | return 251 | 252 | 253 | WebScraping_db2: 254 | Store:=ClipboardAll ;****Store clipboard **** 255 | Clipboard= 256 | ( Join`r`n 257 | // contents of datatable.csv 258 | // DATA,#1,#2,#3 259 | // GITHUB_ID,ironman,batman,superman 260 | // USER_EMAIL,tony@stark.org,bruce@wayne.org,clarke@kent.org 261 | 262 | // TagUI loops through each column to automate using values from different datasets 263 | // set respective User IDs and User Emails and display to screen and log file 264 | 265 | // example of use : 266 | github_id = "```GITHUB_ID```" 267 | user_email = "```USER_EMAIL```"; 268 | echo github_id " - " user_email 269 | ) 270 | Gosub Paste_and_Restore_Stored_Clipboard 271 | return 272 | 273 | 274 | WebScraping_db3: 275 | Store:=ClipboardAll ;****Store clipboard **** 276 | Clipboard= 277 | ( Join`r`n 278 | // form sql query to read from database and save to os script 279 | // on mac/linux be sure that read_db file has execute permission 280 | sql_query = 'mysql DATABASE_NAME -e "SELECT NAME,EMAIL FROM TABLE_NAME"' 281 | dump sql_query to read_db 282 | 283 | // above assumes running as root user from server, if database credentials are required, use below - 284 | // sql_query = 'mysql DATABASE_NAME --user=username --password=\'password\' -e "SELECT NAME,EMAIL FROM TABLE_NAME"' 285 | 286 | // use run step to run the script and retrieve results 287 | run /full_path_to_flow/read_db 288 | db_result = run_result.split('\n') 289 | for row from 1 to db_result.length 290 | { 291 | db_row = db_result[row-1].split('\t') 292 | echo db_row[0] ',' db_row[1] 293 | } 294 | 295 | // form sql query to write to database and save to os script 296 | // on mac/linux be sure that read_db file has execute permission 297 | sql_query = 'mysql DATABASE_NAME -e "UPDATE TABLE_NAME SET NAME=\'KS\' WHERE EMAIL=\'kensoh@gmail.com\'"' 298 | dump sql_query to write_db 299 | 300 | // above assumes running as root user from server, if database credentials are required, use below - 301 | // sql_query = 'mysql DATABASE_NAME --user=username --password=\'password\' -e "SELECT NAME,EMAIL FROM TABLE_NAME"' 302 | 303 | // use run step to run the script to write 304 | run /full_path_to_flow/write_db 305 | 306 | // repeat the reading of database showing new data 307 | run /full_path_to_flow/read_db 308 | db_result = run_result.split('\n') 309 | for row from 1 to db_result.length 310 | { 311 | db_row = db_result[row-1].split('\t') 312 | echo db_row[0] ',' db_row[1] 313 | } 314 | ) 315 | Gosub Paste_and_Restore_Stored_Clipboard 316 | return 317 | 318 | 319 | WebScraping_dropdownitem: 320 | Store:=ClipboardAll ;****Store clipboard **** 321 | Clipboard= 322 | ( Join`r`n 323 | //return number of items in Select dropdown 324 | dom return document.getElementById("BSDATORE").options.length; 325 | echo dom_result 326 | ) 327 | Gosub Paste_and_Restore_Stored_Clipboard 328 | return 329 | 330 | WebScraping_array: 331 | Store:=ClipboardAll ;****Store clipboard **** 332 | Clipboard= 333 | ( Join`r`n 334 | //array declaration 335 | cars = ["Saab", "Volvo", "BMW"]; 336 | ) 337 | Gosub Paste_and_Restore_Stored_Clipboard 338 | return 339 | 340 | 341 | WebScraping_if: 342 | Store:=ClipboardAll ;****Store clipboard **** 343 | Clipboard= 344 | ( Join`r`n 345 | //conditions examples (natural language) 346 | if day equals to "Friday" 347 | if menu contains "fruits" 348 | if A more than B and C not equals to D 349 | ) 350 | Gosub Paste_and_Restore_Stored_Clipboard 351 | return 352 | 353 | WebScraping_R: 354 | Store:=ClipboardAll ;****Store clipboard **** 355 | Clipboard= 356 | ( Join`r`n 357 | // you can use r begin and r finish to denote a R code block 358 | r begin 359 | a=1;b=2 360 | c=a+b 361 | cat(c) 362 | r finish 363 | echo r_result 364 | // alternatively,launch R script like this 365 | r begin 366 | source("/Users/kensoh/Desktop/sampler2.r") 367 | r finish 368 | ) 369 | Gosub Paste_and_Restore_Stored_Clipboard 370 | return 371 | 372 | 373 | WebScraping_for: 374 | Store:=ClipboardAll ;****Store clipboard **** 375 | Clipboard= 376 | ( Join`r`n 377 | //loop for with some element substitution 378 | for i from 1 to 3 379 | { 380 | element_symb = 'ul > li:nth-child(INDEX) .cell-market-name_name' 381 | element_size = 'ul > li:nth-child(INDEX) .cell-size' 382 | element_symb = element_symb.replace("INDEX", i); 383 | element_size = element_size.replace("INDEX", i); 384 | 385 | if present(element_symb) 386 | { 387 | read '+element_symb+' to symb 388 | read '+element_size+' to size 389 | echo 'result : ' + symb + ' : ' + size 390 | } 391 | } 392 | ) 393 | Gosub Paste_and_Restore_Stored_Clipboard 394 | return 395 | 396 | WebScraping_checkmybox: 397 | Store:=ClipboardAll ;****Store clipboard **** 398 | Clipboard= 399 | ( Join`r`n 400 | // Check checkbox 401 | dom document.forms[0].settimaneRetribuzioneSelezionate[0].checked = true; 402 | ) 403 | Gosub Paste_and_Restore_Stored_Clipboard 404 | return 405 | 406 | WebScraping_indexof: 407 | Store:=ClipboardAll ;****Store clipboard **** 408 | Clipboard= 409 | ( Join`r`n 410 | //return 1st position of string in other string 411 | str = "Hello world"; 412 | position = str.indexOf("e"); 413 | // string.indexOf(searchvalue, start) 414 | echo "position= " + position 415 | ) 416 | Gosub Paste_and_Restore_Stored_Clipboard 417 | return 418 | 419 | 420 | WebScraping_case: 421 | Store:=ClipboardAll ;****Store clipboard **** 422 | Clipboard= 423 | ( Join`r`n 424 | //convert Lowercase/uppercase 425 | myString = myString.toLowerCase(); 426 | myString = myString.toUpperCase(); 427 | ) 428 | Gosub Paste_and_Restore_Stored_Clipboard 429 | return 430 | 431 | 432 | WebScraping_substring: 433 | Store:=ClipboardAll ;****Store clipboard **** 434 | Clipboard= 435 | ( Join`r`n 436 | //extract some characters from a string 437 | str = "Hello world!"; 438 | res = str.substring(1, 4); 439 | echo "res= " + res 440 | ) 441 | Gosub Paste_and_Restore_Stored_Clipboard 442 | return 443 | 444 | 445 | WebScraping_substitute: 446 | Store:=ClipboardAll ;****Store clipboard **** 447 | Clipboard= 448 | ( Join`r`n 449 | //substitute comma by dot 450 | str='5,17' 451 | newstr=str.replace(',', '.'); 452 | echo "newstr= " + newstr 453 | ) 454 | Gosub Paste_and_Restore_Stored_Clipboard 455 | return 456 | 457 | WebScraping_atribute: 458 | Store:=ClipboardAll ;****Store clipboard **** 459 | Clipboard= 460 | ( Join`r`n 461 | //Getting href (or other attributes) of web element 462 | element_identifier = '#c_16 > div:nth-child(1) > h3 > a' 463 | myurl = this.getElementsAttribute(element_identifier, 'href') 464 | echo myurl 465 | ) 466 | Gosub Paste_and_Restore_Stored_Clipboard 467 | return 468 | 469 | 470 | WebScraping_checkbox: 471 | Store:=ClipboardAll ;****Store clipboard **** 472 | Clipboard= 473 | ( Join`r`n 474 | //return if a checkbox is checked, example: 475 | http://echoecho.com/htmlforms09.htm 476 | dom return document.querySelector('input[type="checkbox"]:nth-child(2)').checked 477 | if dom_result equals to true 478 | variable=1 479 | else 480 | variable=0 481 | echo 'variable: '+variable 482 | ) 483 | Gosub Paste_and_Restore_Stored_Clipboard 484 | return 485 | 486 | 487 | WebScraping_proxy: 488 | Store:=ClipboardAll ;****Store clipboard **** 489 | Clipboard= 490 | ( Join`r`n 491 | //accessing the next URL under that proxy. 492 | //The last 2 parameters are the username and password, if your proxy service provider requires credentials. 493 | phantom.setProxy('IP', 'port', 'manual', '', ''); 494 | https://www.google.com/ 495 | ) 496 | Gosub Paste_and_Restore_Stored_Clipboard 497 | return 498 | 499 | WebScraping_popup: 500 | Store:=ClipboardAll ;****Store clipboard **** 501 | Clipboard= 502 | ( Join`r`n 503 | http://tebel.org/index_mobile.php 504 | // click ABOUT footer to open a new tab window 505 | click ABOUT 506 | // the execution context is still at the original window 507 | // in order to interact with the new tab window use popup step 508 | // the popup step looks for a keyword in the urls within the 509 | // list of tabs that you have opened in this session of tagui 510 | // after the next step, context returns to original window 511 | popup about_tebel 512 | { 513 | print file-about_tebel-LC2 514 | snap file-about_tebel-LC2 515 | } 516 | ) 517 | Gosub Paste_and_Restore_Stored_Clipboard 518 | return 519 | 520 | 521 | WebScraping_frame: 522 | Store:=ClipboardAll ;****Store clipboard **** 523 | Clipboard= 524 | ( Join`r`n 525 | // for frame step it is used to access webpage implemented as a frame within another webpage 526 | // the usage is similar to popup step, except that the parameter is the frame name 527 | // if there is a subframe within the mainframe, use frame mainframe | subframe 528 | frame framename 529 | { 530 | ***do something*** 531 | } 532 | ) 533 | Gosub Paste_and_Restore_Stored_Clipboard 534 | return 535 | 536 | 537 | WebScraping_tableelements: 538 | Store:=ClipboardAll ;****Store clipboard **** 539 | Clipboard= 540 | ( Join`r`n 541 | // go to another web page with a table to practice for loop 542 | https://github.com/tebelorg/TLE 543 | // for loop can be expressed in natural language or JavaScript 544 | for column from 1 to 6 545 | { 546 | // '+variable_name+' can be used where text is expected 547 | show (//table)[3]//td['+column+'] 548 | } 549 | ) 550 | Gosub Paste_and_Restore_Stored_Clipboard 551 | return 552 | 553 | 554 | WebScraping_webtext: 555 | Store:=ClipboardAll ;****Store clipboard **** 556 | Clipboard= 557 | ( Join`r`n 558 | //return text in command 559 | echo 'text: ' text() 560 | ) 561 | Gosub Paste_and_Restore_Stored_Clipboard 562 | return 563 | 564 | 565 | WebScraping_url: 566 | Store:=ClipboardAll ;****Store clipboard **** 567 | Clipboard= 568 | ( Join`r`n 569 | //return url in command 570 | echo 'page url: ' url() 571 | //you can use also: 572 | echo 'UPLOADED URL - ' this.getCurrentUrl() + '\n' 573 | //append url in file 574 | write url() to urllist.txt 575 | ) 576 | Gosub Paste_and_Restore_Stored_Clipboard 577 | return 578 | 579 | 580 | WebScraping_text: 581 | Store:=ClipboardAll ;****Store clipboard **** 582 | Clipboard= 583 | ( Join`r`n 584 | //check before if page contain text 585 | check text() contains "Click here" | "page text contains this text" | "page text does NOT contain this text" 586 | //click on text 587 | click //*[text()="Click here"] 588 | //click on text contained in variable 589 | click //*[text()="'+variable+'"] 590 | ) 591 | Gosub Paste_and_Restore_Stored_Clipboard 592 | return 593 | 594 | 595 | WebScraping_checkelement: 596 | Store:=ClipboardAll ;****Store clipboard **** 597 | Clipboard= 598 | ( Join`r`n 599 | //check if page contain element 600 | if present('element_identifier') 601 | { 602 | fetch element_identifier to element_info 603 | echo element_info 604 | } 605 | //check if element is visible 606 | if visible('element_identifier') 607 | { 608 | fetch element_identifier to element_info 609 | echo element_info 610 | } 611 | ) 612 | Gosub Paste_and_Restore_Stored_Clipboard 613 | return 614 | 615 | 616 | 617 | WebScraping_checktext: 618 | Store:=ClipboardAll ;****Store clipboard **** 619 | Clipboard= 620 | ( Join`r`n 621 | //check if page contain text 622 | check text() contains "text" | "page text contains text" | "page text does not contain text" 623 | //Other way : if string variable is found make some action 624 | stringvariable='my text'; 625 | if present('//*[text()="'+stringvariable+'"]') 626 | { 627 | echo stringvariable + ' is present' 628 | } 629 | ) 630 | Gosub Paste_and_Restore_Stored_Clipboard 631 | return 632 | 633 | WebScraping_timer: 634 | Store:=ClipboardAll ;****Store clipboard **** 635 | Clipboard= 636 | ( Join`r`n 637 | // use timer() as a stopwatch to track elapsed time between calls 638 | start = timer() 639 | 640 | // ... some actions... 641 | 642 | // use timer() as a stopwatch to track elapsed time between calls 643 | time_taken = timer() 644 | echo 'time taken - ' time_taken ' seconds' 645 | ) 646 | Gosub Paste_and_Restore_Stored_Clipboard 647 | return 648 | 649 | 650 | WebScraping_countel: 651 | Store:=ClipboardAll ;****Store clipboard **** 652 | Clipboard= 653 | ( Join`r`n 654 | //specify same id, class name of all elements on the page... 655 | count_number = count('uh-tb-') 656 | echo 'count_number = ' count_number 657 | ) 658 | Gosub Paste_and_Restore_Stored_Clipboard 659 | return 660 | 661 | WebScraping_present: 662 | Store:=ClipboardAll ;****Store clipboard **** 663 | Clipboard= 664 | ( Join`r`n 665 | if present('Selector') 666 | { 667 | //STUFF// 668 | } 669 | ) 670 | Gosub Paste_and_Restore_Stored_Clipboard 671 | return 672 | 673 | WebScraping_ifcontain: 674 | Store:=ClipboardAll ;****Store clipboard **** 675 | Clipboard:="if ****text variable(without quotation marks)*** contains 'text (with quotation marks)' " 676 | Gosub Paste_and_Restore_Stored_Clipboard 677 | return 678 | 679 | WebScraping_checkpres: 680 | Store:=ClipboardAll ;****Store clipboard **** 681 | Clipboard:="check present('search-buttons') | 'search button exists' | 'search button does not exist' " 682 | Gosub Paste_and_Restore_Stored_Clipboard 683 | return 684 | 685 | WebScraping_checkcount: 686 | Store:=ClipboardAll ;****Store clipboard **** 687 | Clipboard:="check count('uh-tb-') more than or equals to 6|'header menu items >= 6'|'header menu items < 6' " 688 | Gosub Paste_and_Restore_Stored_Clipboard 689 | return 690 | 691 | 692 | 693 | WebScraping_domloop: 694 | Store:=ClipboardAll ;****Store clipboard **** 695 | Clipboard= 696 | ( Join`r`n 697 | // JavaScript can be used directly in the flow for more expressive and advanced automation 698 | // default execution context for JavaScript is local, to work on webpage dom, use dom step 699 | // following loop through directly in webpage dom to compile and return list of profile ids 700 | dom id_list = ""; for (n=1;n<=51;n++) {id_list += document.querySelector('.follow-list-item:nth-child('+n+') a').href + '\n'}; return id_list; 701 | echo dom_result 702 | // you can also use JavaScript to do post-processing and write to a file, or to a format directly usable by flow 6B 703 | var fs = require('fs'); fs.write("/tmp/urls.csv", dom_result + "\n", 'w'); 704 | ) 705 | Gosub Paste_and_Restore_Stored_Clipboard 706 | return 707 | 708 | WebScraping_domsave: 709 | Store:=ClipboardAll ;****Store clipboard **** 710 | Clipboard= 711 | ( Join`r`n 712 | // you can also use JavaScript to do post-processing and write to a file, or to a format directly usable by flow 6B 713 | var fs = require('fs'); fs.write("/tmp/urls.csv", dom_result + "\n", 'w'); 714 | ) 715 | Gosub Paste_and_Restore_Stored_Clipboard 716 | return 717 | 718 | WebScraping_receive: 719 | Store:=ClipboardAll ;****Store clipboard **** 720 | Clipboard:="receive ***url keyword*** to ***filename*** " 721 | Gosub Paste_and_Restore_Stored_Clipboard 722 | return 723 | 724 | WebScraping_download: 725 | Store:=ClipboardAll ;****Store clipboard **** 726 | Clipboard:="download ***url*** to ***filename*** " 727 | Gosub Paste_and_Restore_Stored_Clipboard 728 | return 729 | 730 | 731 | WebScraping_upload: 732 | Store:=ClipboardAll ;****Store clipboard **** 733 | Clipboard:="upload ***element*** as ***filename*** //note: CSS selector only " 734 | Gosub Paste_and_Restore_Stored_Clipboard 735 | return 736 | 737 | WebScraping_attribute: 738 | Store:=ClipboardAll ;****Store clipboard **** 739 | Clipboard:="js myurl = this.getElementsAttribute(element_identifier, 'href');" 740 | Gosub Paste_and_Restore_Stored_Clipboard 741 | return 742 | 743 | WebScraping_wait: 744 | Store:=ClipboardAll ;****Store clipboard **** 745 | Clipboard:="wait ***time in seconds(optional)*** //note: default is 5 sec. " 746 | Gosub Paste_and_Restore_Stored_Clipboard 747 | return 748 | 749 | WebScraping_live: 750 | Store:=ClipboardAll ;****Store clipboard **** 751 | Clipboard:="live ***try steps or code interactively in Chrome / PhantomJS*** //note: Firefox not yet " 752 | Gosub Paste_and_Restore_Stored_Clipboard 753 | return 754 | 755 | WebScraping_check: 756 | Store:=ClipboardAll ;****Store clipboard **** 757 | Clipboard:="check ***condition*** | 'text if true' | 'text if false' //note: text in quotes " 758 | Gosub Paste_and_Restore_Stored_Clipboard 759 | return 760 | 761 | 762 | WebScraping_run: 763 | Store:=ClipboardAll ;****Store clipboard **** 764 | Clipboard= 765 | ( Join`r`n 766 | tagui ***filename*** options(s) 767 | //OPTION LIST: 768 | //headless run on invisible Chrome web browser instead of default PhantomJS (first install Chrome) 769 | //chrome run on visible Chrome web browser instead of invisible PhantomJS (first install Chrome) 770 | //firefox run on visible Firefox web browser instead of invisible browser (first install Firefox) 771 | //upload upload automation flow and result to hastebin.com (expires 30 days after last view) 772 | //report web report for sharing of run results on webserver (default is only a text log file) 773 | //debug show run-time backend messages from PhantomJS for detailed tracing and logging 774 | //quiet run without output except for explicit output (echo / show / check / errors etc) 775 | //speed skip 3-second delay between datatable iterations (and skip restarting of Chrome) 776 | //test testing with check step test assertions for CI/CD integration (output XUnit XML file) 777 | //baseline output execution log and relative-path output files to a separate baseline directory 778 | //input(s) add your own parameter(s) to be used in your automation flow as variables p1 to p9 779 | //i.e. Command Line: tagui demo chrome apple orange banana 780 | //i.e. Script get inputs: 781 | //echo "parameter 1 is - " p1 782 | //echo "parameter 2 is - " p2 783 | //echo "parameter 3 is - " p3 784 | ) 785 | Gosub Paste_and_Restore_Stored_Clipboard 786 | return 787 | 788 | WebScraping_table: 789 | Store:=ClipboardAll ;****Store clipboard **** 790 | Clipboard:="table ***element*** to optional filename.csv ***filename.csv (optional)*** //note: XPath selector only " 791 | Gosub Paste_and_Restore_Stored_Clipboard 792 | return 793 | 794 | 795 | WebScraping_snap_pdf: 796 | Store:=ClipboardAll ;****Store clipboard **** 797 | Clipboard:="snap page to ***filename.pdf*** //note: headless Chrome / PhantomJS " 798 | Gosub Paste_and_Restore_Stored_Clipboard 799 | return 800 | 801 | 802 | WebScraping_snap: 803 | Store:=ClipboardAll ;****Store clipboard **** 804 | Clipboard= 805 | ( Join`r`n 806 | //note: you can snap element or entire page 807 | snap page to myscript.png 808 | ) 809 | Gosub Paste_and_Restore_Stored_Clipboard 810 | return 811 | 812 | WebScraping_snappage: 813 | Store:=ClipboardAll ;****Store clipboard **** 814 | Clipboard:="snap page" 815 | Gosub Paste_and_Restore_Stored_Clipboard 816 | return 817 | 818 | 819 | go_to_url: 820 | Store:=ClipboardAll ;****Store clipboard **** 821 | Clipboard= 822 | ( Join`r`n 823 | // just enter full url of webpage ('+variable+' for variable) 824 | https://www.webpage.com/ 825 | ) 826 | Gosub Paste_and_Restore_Stored_Clipboard 827 | return 828 | 829 | WebScraping_Click: 830 | Store:=ClipboardAll ;****Store clipboard **** 831 | Clipboard:="click ***element*** //i.e. using variable: click '+element_identifier+' " 832 | Gosub Paste_and_Restore_Stored_Clipboard 833 | return 834 | 835 | 836 | WebScraping_image: 837 | Store:=ClipboardAll ;****Store clipboard **** 838 | Clipboard= 839 | ( Join`r`n 840 | //click on specific image file (use Screenshoter tool) 841 | click C:\TagUI\filename.png 842 | ) 843 | Gosub Paste_and_Restore_Stored_Clipboard 844 | return 845 | 846 | WebScraping_mouse: 847 | Store:=ClipboardAll ;****Store clipboard **** 848 | Clipboard= 849 | ( Join`r`n 850 | //click on current mouse position using Sikuli 851 | //left click 852 | vision click(atMouse()) 853 | 854 | //right click 855 | vision rightClick(atMouse()) 856 | 857 | //double click 858 | vision doubleClick(atMouse()) 859 | ) 860 | Gosub Paste_and_Restore_Stored_Clipboard 861 | return 862 | 863 | 864 | Store:=ClipboardAll ;****Store clipboard **** 865 | Clipboard:="click C:/myimage.png " 866 | Gosub Paste_and_Restore_Stored_Clipboard 867 | return 868 | 869 | 870 | WebScraping_Click_Focus: 871 | Store:=ClipboardAll ;****Store clipboard **** 872 | Clipboard:="hover '***element***' " 873 | Gosub Paste_and_Restore_Stored_Clipboard 874 | return 875 | 876 | 877 | WebScraping_enter: 878 | Store:=ClipboardAll ;****Store clipboard **** 879 | Clipboard= 880 | ( Join`r`n 881 | //entering text replicating user actions when typing the text character by character 882 | enter ***element*** as my text 883 | //entering variable without quotation marks 884 | enter ***element*** as variable 885 | //entering array variable with special marks 886 | enter ***element*** as '+array[1]+' 887 | //To set the value directly of HTML element, you can use dom step: 888 | dom_json = 'long string of text' 889 | dom document.getElementById('uh-search-box').value = dom_json 890 | ) 891 | Gosub Paste_and_Restore_Stored_Clipboard 892 | return 893 | 894 | 895 | 896 | WebScraping_csv: 897 | Store:=ClipboardAll ;****Store clipboard **** 898 | Clipboard= 899 | ( Join`r`n 900 | // write the information received into a csv spreadsheet file 901 | // set file to appropriate location, especially if using Windows 902 | var fs = require('fs'); fs.write("/tmp/contacts.csv", "\""+fullname+"\",\""+username+"\",\""+email+"\",\""+url+"\",\""+country+"\",\""+bio+"\"\n", 'a'); 903 | ) 904 | Gosub Paste_and_Restore_Stored_Clipboard 905 | return 906 | 907 | 908 | 909 | WebScraping_content: 910 | Store:=ClipboardAll ;****Store clipboard **** 911 | Clipboard= 912 | ( Join`r`n 913 | //email to check/append 914 | email="pinco1@gmail.com"; 915 | 916 | //path of file to create/use 917 | //this file must exist: 918 | path="/tmp/myfile.csv"; 919 | 920 | fs = require('fs');if (!fs.exists(path)) fs.write(path, 'Mailing list \n', 'w'); 921 | 922 | load '+path+' to database_emails 923 | echo 'database_emails: '+database_emails 924 | 925 | if (database_emails.indexOf(email)>-1) 926 | { 927 | echo 'email already exist in database' 928 | } 929 | else 930 | { 931 | echo 'email added in database' 932 | write email to '+path+' 933 | } 934 | ) 935 | Gosub Paste_and_Restore_Stored_Clipboard 936 | return 937 | 938 | 939 | 940 | WebScraping_enterrepo: 941 | Store:=ClipboardAll ;****Store clipboard **** 942 | Clipboard= 943 | ( Join`r`n 944 | // contents of datatable.csv 945 | // DATA,#1,#2,#3 946 | // GITHUB_ID,ironman,batman,superman 947 | // USER_EMAIL,tony@stark.org,bruce@wayne.org,clarke@kent.org 948 | 949 | enter ***element*** as "```GITHUB_ID```" 950 | ) 951 | Gosub Paste_and_Restore_Stored_Clipboard 952 | return 953 | 954 | WebScraping_pressenter: 955 | Store:=ClipboardAll ;****Store clipboard **** 956 | Clipboard:="enter ***element*** as [enter] " 957 | Gosub Paste_and_Restore_Stored_Clipboard 958 | return 959 | 960 | WebScraping_option: 961 | Store:=ClipboardAll ;****Store clipboard **** 962 | Clipboard:="select ***element*** as ***option value*** //note: [clear] = clear selection " 963 | Gosub Paste_and_Restore_Stored_Clipboard 964 | return 965 | 966 | WebScraping_read: 967 | Store:=ClipboardAll ;****Store clipboard **** 968 | Clipboard:="read ***element*** to ***variable name*** " 969 | Gosub Paste_and_Restore_Stored_Clipboard 970 | return 971 | 972 | WebScraping_echo: 973 | Store:=ClipboardAll ;****Store clipboard **** 974 | Clipboard:="echo ***text (in quotation marks)*** and variables (without quotation)" 975 | Gosub Paste_and_Restore_Stored_Clipboard 976 | return 977 | 978 | WebScraping_print: 979 | Store:=ClipboardAll ;****Store clipboard **** 980 | Clipboard:="print ***element*** " 981 | Gosub Paste_and_Restore_Stored_Clipboard 982 | return 983 | 984 | WebScraping_save: 985 | Store:=ClipboardAll ;****Store clipboard **** 986 | Clipboard:="save ***element*** to ***filename(optional)***" 987 | Gosub Paste_and_Restore_Stored_Clipboard 988 | return 989 | 990 | WebScraping_dump: 991 | Store:=ClipboardAll ;****Store clipboard **** 992 | Clipboard:="dump ***text and variables*** to ***filename***" 993 | Gosub Paste_and_Restore_Stored_Clipboard 994 | return 995 | 996 | WebScraping_append: 997 | Store:=ClipboardAll ;****Store clipboard **** 998 | Clipboard:="write ***text and variables*** to ***filename***" 999 | Gosub Paste_and_Restore_Stored_Clipboard 1000 | return 1001 | 1002 | WebScraping_load: 1003 | Store:=ClipboardAll ;****Store clipboard **** 1004 | Clipboard:="load ***filename*** to ***variable name***" 1005 | Gosub Paste_and_Restore_Stored_Clipboard 1006 | return 1007 | 1008 | 1009 | ;****************************** 1010 | ;***********Subroutines******************* 1011 | ;****************************** 1012 | ;*******Store Clipboard- **************** 1013 | Store_Clipboard_Copy_Selected_Text: 1014 | Store:=ClipboardAll ;Store full version of Clipboard 1015 | clipboard :="" ; Empty the clipboard 1016 | Send, ^c ;Depending on your OS and Admin level- you might want to check this 1017 | ClipWait, 1 1018 | return 1019 | 1020 | ;***********Restore clipboard******************* 1021 | Paste_and_Restore_Stored_Clipboard: ;~ MsgBox % clipboard 1022 | Sleep, 50 1023 | Send, ^v ;Depending on your OS and Admin level- you might want to check this 1024 | Sleep, 50 1025 | Clipboard:=Store ;Restore clipboard to original contents 1026 | return 1027 | 1028 | 1029 | 1030 | ;***********Helpful Links******************* 1031 | Helpful_Links: 1032 | Gui, Helpful:Destroy 1033 | Gui, Helpful:Font,Bold cBlack Norm 1034 | Gui, Helpful:Add,Text,y+5 ,Tagui Links 1035 | Gui, Helpful:Font,CBlue Underline 1036 | Gui, Helpful:Add,Text,y+5 GTagui_Github, TagUI GitHub 1037 | Gui, Helpful:Add,Text,y+5 GTagui_Tutorial, TagUI Youtube Tutorial 1038 | ;****************************** 1039 | Gui, Helpful:Font,Bold cBlack Norm 1040 | Gui, Helpful:Add,Text,y+20, Tagui Writer 1041 | Gui, Helpful:Font,CBlue Underline 1042 | Gui, Helpful:Add,Text,y+10 GTagui_writer, Tagui Writer 1043 | 1044 | hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND 1045 | onMessage(0x200, "MsgHandler") 1046 | 1047 | Gui, Helpful:Show,w225 , Helpful links 1048 | return 1049 | 1050 | 1051 | 1052 | ;***********About me******************* 1053 | About: 1054 | Gui,About:Destroy 1055 | Gui,About:Font,Bold 1056 | Gui,About:Add,Text,x10 y10,WebScraping Menu v1.0 1057 | Gui,About:Font,Norm 1058 | Gui,About:Add,Text,x10 y30,To activate menu, Hold down a control key and click the left mouse button 1059 | 1060 | Gui,About:Font 1061 | Gui,About:Font,CBlue Underline 1062 | hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND 1063 | onMessage(0x200, "MsgHandler") 1064 | Gui,About:Font 1065 | Gui,About:Show,, About 1066 | return 1067 | 1068 | 1069 | Tagui_Github: 1070 | Run, https://github.com/kelaberetiv/TagUI 1071 | gosub GuiClose 1072 | Return 1073 | 1074 | 1075 | Tagui_Tutorial: 1076 | Run, https://www.youtube.com/watch?v=-1M6yuiF7BQ 1077 | gosub GuiClose 1078 | Return 1079 | 1080 | Tagui_writer: 1081 | Run, https://github.com/adegard/tagui_scripts 1082 | gosub GuiClose 1083 | Return 1084 | 1085 | Exit: 1086 | ExitApp 1087 | Return 1088 | 1089 | Reload: 1090 | Reload 1091 | Return 1092 | 1093 | Edit: 1094 | Edit 1095 | Return 1096 | 1097 | GuiClose: 1098 | Gui,About:Destroy 1099 | OnMessage(0x200,"") 1100 | DllCall("DestroyCursor","Uint",hCur) 1101 | Return 1102 | -------------------------------------------------------------------------------- /examples/DDGcrawler: -------------------------------------------------------------------------------- 1 | http://www.comuni-italiani.it/province.html 2 | 3 | wait 2 4 | 5 | element_identifier_prov='body > span:nth-child(8) > table:nth-child(3) > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(INDEX) > td:nth-child(2) > b > a'; 6 | 7 | //loop for with some element substitution 8 | for i from 2 to 100 9 | { 10 | element_sel_prov = element_identifier_prov.replace("INDEX", i); 11 | 12 | if present(element_sel_prov) 13 | { 14 | read '+element_sel_prov+' to provincia 15 | 16 | keywords='ospedale+'+provincia+'+contatti'; 17 | echo 'keywords '+keywords 18 | https://duckduckgo.com/?q='+keywords+' 19 | 20 | wait 2 21 | 22 | element_identifier='#r1-INDEX .result__title'; 23 | 24 | //loop for with some element substitution 25 | for i from 0 to 15 26 | { 27 | element_sel = element_identifier.replace("INDEX", i); 28 | 29 | if present(element_sel) 30 | { 31 | click '+element_sel+' 32 | wait 2 33 | mylink= url(); 34 | echo 'mylink: ' mylink 35 | 36 | //scrap email 37 | if text() contains '@' 38 | { 39 | echo "symbol @ found" 40 | strn = text(); 41 | //ini=strn.indexOf("@",0); 42 | //echo 'ini: '+ini 43 | //startn= strn.LastIndexOf(" ", ini); 44 | startn = strn.slice(0, strn.indexOf("@")).lastIndexOf(" "); //get the last occurrence of a string before "@", 45 | echo "startn= " + startn 46 | 47 | endn = strn.indexOf(".",startn+3); 48 | echo "endn= " + endn 49 | 50 | //extract some characters from a string 51 | if strn.substring(startn, endn+1)=='i' 52 | { 53 | email = strn.substring(startn, endn+3); 54 | } 55 | else 56 | { 57 | email = strn.substring(startn, endn+4); 58 | } 59 | echo "email= " + email 60 | 61 | 62 | //path of file to create/use 63 | //this file must exist: 64 | path="/tmp/emails_DDGcrawler.csv"; 65 | 66 | fs = require('fs');if (!fs.exists(path)) fs.write(path, 'Name list \n', 'w'); 67 | 68 | load '+path+' to database_emails 69 | //echo 'database_emails: '+database_emails 70 | 71 | if (database_emails.indexOf(email)>-1) 72 | { 73 | echo 'email already exist in database' 74 | } 75 | else 76 | { 77 | echo 'email added in database' 78 | write email to '+path+' 79 | //entering answer: 80 | //use email api 81 | 82 | 83 | } 84 | 85 | 86 | } 87 | 88 | 89 | } 90 | https://duckduckgo.com/?q='+keywords+' 91 | wait 3 92 | } 93 | 94 | } 95 | http://www.comuni-italiani.it/province.html 96 | wait 1 97 | } -------------------------------------------------------------------------------- /examples/mailtemp: -------------------------------------------------------------------------------- 1 | https://temp-mail.org/it/option/change/ 2 | 3 | read #mail to myemail 4 | snap page 5 | 6 | echo 'my email is ' myemail 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/meteo: -------------------------------------------------------------------------------- 1 | http://www.meteolive.it/previsione-meteo/italia/Lombardia/Milano/1/ 2 | read //*[@id="box-previsioni-content"]/table/tbody/tr[4]/td[3] to prev 3 | 4 | //send email with result 5 | msg='previzioni per domani: ' + prev 6 | echo msg 7 | snap page 8 | -------------------------------------------------------------------------------- /examples/stock: -------------------------------------------------------------------------------- 1 | http://finanza-mercati.ilsole24ore.com/quotazioni.php?QUOTE=!DAX.XET 2 | //print .toptitolo h1 3 | read //*[@id="_DETTOP_"]/div[4]/table/tbody/tr/td[2] to DAXt 4 | DAX= parseFloat(DAXt); 5 | 6 | http://finanza-mercati.ilsole24ore.com/quotazioni.php?QUOTE=!PCAC.PAR 7 | //print .toptitolo h1 8 | read //*[@id="!PCAC.PAR_10015"] to CACt 9 | read //*[@id="!PCAC.PAR_10002|20002"] to date 10 | CAC= parseFloat(CACt); 11 | 12 | 13 | TT=DAX+CAC 14 | echo "date: " date 15 | echo "DAX: " DAX 16 | echo "CAC: " CAC 17 | echo "DAX+CAC :" TT 18 | 19 | 20 | 21 | 22 | http://finanza-mercati.ilsole24ore.com/quotazioni.php?QUOTE=!EURUS.FX 23 | read //*[@id="_DETTOP_"]/div[4]/table/tbody/tr/td[2] to EURUSDt -------------------------------------------------------------------------------- /examples/subitoautoresponder: -------------------------------------------------------------------------------- 1 | https://www.subito.it/annunci-italia/vendita/offerte-lavoro/?qso=false&q=badante 2 | wait 5 3 | 4 | element_identifier = '#template_content > main > div.subcontent > div.main > div.listing > ul.items_listing > li:nth-child(INDEX) > article > div > div.item_list_section.item_description > h2 > a' 5 | 6 | 7 | for i from 3 to 10 8 | { 9 | URLSelector = element_identifier.replace("INDEX", i); 10 | if present(URLSelector) 11 | { 12 | click '+URLSelector+' 13 | wait 2 14 | read #annuncio > header > div.title > h1 to title 15 | 16 | if present('#ad_details > div.summary > table > tbody > tr:nth-child(1) > td.details_label') 17 | { 18 | read #ad_details > div.summary > table > tbody > tr:nth-child(1) > td.details_label to label 19 | } 20 | else 21 | { 22 | label=''; 23 | } 24 | 25 | if present('#ad_details > div.summary > table > tbody > tr:nth-child(1) > td.details_value') 26 | { 27 | read #ad_details > div.summary > table > tbody > tr:nth-child(1) > td.details_value to city 28 | } 29 | else 30 | { 31 | city=''; 32 | } 33 | 34 | read #ad_details > div.description to testo 35 | read #user_info_container > div.content_box > div.publisher_info > h2 to name 36 | read #annuncio > header > div.profile > div > div.data to type 37 | //return url in command 38 | mylink= url(); 39 | echo 'title: ' title 40 | 41 | 42 | 43 | //return text in command 44 | echo 'testo: ' testo 45 | echo 'city: ' city 46 | echo 'name: ' name 47 | echo 'type: ' type 48 | echo 'mylink: ' mylink 49 | 50 | 51 | //SEND SMS to writer 52 | //control presence of button tel number 53 | if present('#desktop-actions-container > div > div.desktop-show-phone-number > div.phone-label > div.button-container.secondary') 54 | { 55 | click #desktop-actions-container > div > div.desktop-show-phone-number > div.phone-label > div.button-container.secondary 56 | 57 | read #desktop-actions-container > div > div.desktop-show-phone-number > div.small_dialog_wrapper.show > div > div.smd_body > div > div > div.phone-number to tel 58 | 59 | 60 | echo tel 61 | 62 | // send SMS throught Skebby SMS Gateway 63 | // SEE TO INSTALL: https://github.com/adegard/SMS-Marketing 64 | // in the following row: update with your server path and APIKEY: 65 | 66 | //https://www.***myserver***.com/sendsmsapi.php?APIKEY=***APIKEYNUMBER***&SENDNAME='+name+'&TEL='+tel+' 67 | 68 | snap page 69 | } 70 | 71 | wait 2 72 | 73 | 74 | https://www.subito.it/annunci-italia/vendita/offerte-lavoro/?qso=false&q=badante 75 | wait 2 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /screenshoter.ahk: -------------------------------------------------------------------------------- 1 | /*adapted from original: 2 | SilentScreenshooter v1.9 3 | 4 | https://github.com/Drugoy/Autohotkey-scripts-.ahk/edit/master/SilentScreenshotter/SilentScreenshotter(+upload).ahk 5 | */ 6 | ;{ Initialization before settings 7 | #SingleInstance, Off 8 | #NoEnv 9 | Menu, tray, icon, %A_WinDir%\system32\shell32.dll, 140 10 | 11 | 12 | 13 | 14 | SetWorkingDir, %A_ScriptDir% 15 | FileInstall, optipng.exe, optipng.exe 16 | CoordMode, Mouse 17 | CoordMode, Pixel 18 | SetBatchLines, -1 19 | Hotkey, $Esc,, Off 20 | OnExit, Exit 21 | ;} 22 | ;{ Settings 23 | If (A_IsCompiled) 24 | { 25 | IniRead, imgPath, settings.ini, settings, imgPath, % A_Temp "\" 26 | IniRead, imgName, settings.ini, settings, imgName, % A_Now 27 | IniRead, imgExtension, settings.ini, settings, imgExtension, png 28 | IniRead, optimizePNG, settings.ini, settings, optimizePNG, 7 29 | IniRead, optipngPath, settings.ini, settings, optipngPath, % A_ScriptDir "\optipng.exe" 30 | IniRead, clipURL, settings.ini, settings, clipURL, 1 31 | IniRead, tempScreenshot, settings.ini, settings, tempScreenshot, 1 32 | IniRead, jpgQuality, settings.ini, settings, jpgQuality, 100 33 | } 34 | Else 35 | { 36 | imgPath := A_ScriptDir "\" ; Specify path and screenshot's name. A_Temp %MyWin% 37 | imgName := A_Now ; Specify locally saved image's name. Default name is the date stamp (with time). 38 | imgExtension := "png" ; Specify desired file format (most of common formats are supported). 39 | optimizePNG := 0 ; Use values from 0 to 7 to specify the compression level: 0 = no compression, 7 = max compression. Compression is always lossless, but works only for PNG. 40 | optipngPath := A_ScriptDir "\optipng.exe" ; Specify path to "optipng.exe" If you would like to use it. 41 | clipURL := 2 ; 0 = the image's URL will be opened in browser; 1 = copy to clipboard; 2 = do both. 42 | tempScreenshot := 0 ; 0 = the local screenshot won't get deleted after it got uploaded to the server, 1 = it will be removed as soon as the file got uploaded to the server. 43 | jpgQuality := 100 ; Use values from 0 to 100 to specify quality for screenshots in JPEG (by default PNG is used). 44 | ; ListLines, Off ; Uncomment this if the script is fully working for you and you'd like to save a bit of RAM by sacrificing script's self-debugging ability. 45 | } 46 | ;} 47 | Global imgurClientID, proxyEnable, proxyServer, clipURL, tempScreenshot, uploadProgress 48 | Global ptr := A_PtrSize ? "UPtr" : "UInt" 49 | targetToUpload := [] 50 | RegRead, proxyEnable, HKCU, Software\Microsoft\Windows\CurrentVersion\Internet Settings, ProxyEnable ; Detect wheter proxy is used or not. 51 | If (proxyEnable) 52 | 53 | RegRead, proxyServer, HKCU, Software\Microsoft\Windows\CurrentVersion\Internet Settings, ProxyServer ; Detect address of proxy. 54 | 55 | imgName := A_Now 56 | imgPath := A_ScriptDir "\" imgName "." imgExtension 57 | 58 | pToken := Gdip_Startup() 59 | 60 | If (%0%) ; Usually %0% contains the number of command line parameters, but when the user drag'n'drops files onto the script - each of the dropped file gets sent to script as a separate command line parameter, so %0% contains the number of dropped files. 61 | { 62 | Loop, %0% 63 | targetToUpload.Insert({"path": %A_Index%, "dnd": 1}) 64 | upload(targetToUpload) 65 | } 66 | If (isThereAnotherInstance()) 67 | ExitApp 68 | Return 69 | 70 | 71 | 72 | 73 | $Esc:: ; Escape hotkey is used in this script to cancel screenshot area selection. This hotkey is temporary and is enabled only during the periods when the screenshot area selection is active (when red border follows the cursor), the rest of the time this hotkey is disabled in order not to cause any issues with the "Escape" key's work in other programs. 74 | Hotkey, $Esc,, Off 75 | DllCall("gdiplus\GdipDisposeImage", ptr, pBitmap) 76 | firstHit_EventFired := "" 77 | Gui, 1: Destroy 78 | Return 79 | 80 | PrintScreen:: ; Since we use the same hotkey trice, we have to distinguish the calls. 81 | Thread, Priority, 1 82 | KeyWait, %A_ThisHotkey% 83 | If !(firstHit_EventFired) ; The user hit PrintScreen - this is a first step. 84 | { 85 | Hotkey, $Esc,, On 86 | SysGet, x0, 76 87 | SysGet, y0, 77 88 | SysGet, w0, 78 89 | SysGet, h0, 79 90 | firstHit_EventFired := 1 91 | MouseGetPos, x1, y1 92 | Gui, 1: -Caption +E0x80000 +HWNDhwnd1 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs ; Create a GUI to use it as a canvas for GDI+ drawing. 93 | Gui, 1: Show, NA 94 | Loop 95 | { 96 | ; Draw a rectangular following the cursor. 97 | MouseGetPos, x2, y2 98 | hbm := CreateDIBSection(w0, h0) 99 | hdc := DllCall("CreateCompatibleDC", ptr, 0) 100 | obm := DllCall("SelectObject", ptr, hdc, ptr, hbm) 101 | DllCall("gdiplus\GdipCreateFromHDC", ptr, hdc, ptr "*", G) 102 | DllCall("gdiplus\GdipSetSmoothingMode", ptr, G, "Int", 4) 103 | DllCall("gdiplus\GdipCreatePen1", "UInt", 0xffff0000, "Float", 1, "Int", 2, ptr "*", pPen) 104 | Gdip_DrawLines(G, pPen, x1 - x0 "," y1 - y0 "|" x2 - x0 "," y1 - y0 "|" x2 - x0 "," y2 - y0 "|" x1 - x0 "," y2 - y0 "|" x1 - x0 "," y1 - y0) 105 | DllCall("gdiplus\GdipDeleteBrush", ptr, pPen) 106 | UpdateLayeredWindow(hwnd1, hdc, x0, y0, w0, h0) 107 | DllCall("SelectObject", ptr, hdc, ptr, obm) 108 | DllCall("DeleteObject", ptr, hbm) 109 | DllCall("DeleteDC", ptr, hdc) 110 | DllCall("gdiplus\GdipDeleteGraphics", ptr, G) 111 | Sleep, 20 ; This pause is used to redraw the rectangular less frequently in order to consume less CPU resources. You may adjust the value (it's in miliseconds). 112 | If GetKeyState("Escape", "P") ; User decided to abort screenshooting. 113 | { 114 | GoSub, $Esc ; Abort drawing, unregister "Escape" hotkey. 115 | Break 116 | } 117 | ; Second step: user finished selecting the area to screenshoot. 118 | If (GetKeyState("LButton", "P")) 119 | Break 120 | If (GetKeyState(A_ThisHotkey, "P")) 121 | { 122 | KeyWait, %A_ThisHotkey% ; In order to get away from possible issues - let's wait until the PrintScreen key is unpressed. 123 | Break 124 | } 125 | } 126 | Return 127 | } 128 | Else ; User has to hit PrintScreen once again (for the 3rd time) to take a screenshot. I inteionally made not 2, but 3 steps required to take a screenshot: so you can take a screenshot of some event happening, for example, only when you hover something special. 129 | { 130 | Hotkey, $Esc,, Off 131 | firstHit_EventFired := "" 132 | Gui, 1: Destroy ; Hide the rectangular before screenshotting the area 133 | ; Save a screenshot to a file. 134 | pBitmap := Gdip_BitmapFromScreen((x1 < x2 ? x1 : x2) "|" (y1 < y2 ? y1 : y2) "|" (x1 < x2 ? x2 - x1 + 1 : x1 - x2 + 1) "|" (y1 < y2 ? y2 - y1 + 1 : y1 - y2 + 1)) 135 | 136 | imgName := A_Now 137 | imgPath := A_ScriptDir "\" imgName "." imgExtension 138 | 139 | Gdip_SaveBitmapToFile(pBitmap, imgPath, jpgQuality) 140 | While !(FileExist(imgPath)) ; Wait until the file gets actually created (otherwise the script will execute the next part too fast). 141 | Sleep, 25 142 | DllCall("gdiplus\GdipDisposeImage", ptr, pBitmap) ; Clean after self. 143 | If (optimizePNG) ; Run png optimizator if user chose to do so. 144 | IfExist, %optipngPath% ; Run it only if it exists. 145 | RunWait, %optipngPath% -o%optimizePNG% -i0 -nc -nb -q -clobber %imgPath%,, Hide 146 | Else 147 | TrayTip, Error, Optipng not found`, thus can't optimize the image. 148 | targetToUpload := [] 149 | targetToUpload.Insert({"path": imgPath}) 150 | 151 | MsgBox, "Copy to clipboard :" %imgPath% 152 | IfMsgBox, OK 153 | Clipboard := imgPath 154 | 155 | Return ; User pressed the "No" button. 156 | 157 | 158 | } 159 | 160 | ExitApp 161 | Return 162 | 163 | Exit: 164 | DllCall("gdiplus\GdiplusShutdown", ptr, pToken) 165 | If (hModule := DllCall("GetModuleHandle", "Str", "gdiplus", ptr)) 166 | DllCall("FreeLibrary", ptr, hModule) 167 | ExitApp 168 | 169 | upload(input) ; Thanks to: maestrith http://www.autohotkey.com/board/user/910-maestrith/ and GeekDude https://github.com/G33kDude 170 | { ; Upload to Imgur using it's API. 171 | Critical, On 172 | imgURLs := [], filtered := uploadProgress := trueIndex := 0 173 | httpObj := Object() 174 | Gui, -Caption +Border +AlwaysOnTop +ToolWindow 175 | ; Gui, ProgressBar: Color, EEAA99 176 | Gui, +LastFound 177 | ; WinSet, TransColor, EEAA99 178 | Gui, Add, Text, x0 y0, Uploading image(s) 179 | Gui, Add, Progress, w300 h10 cGreen -0x1 vuploadProgress 180 | Gui, Show, % "x" A_ScreenWidth - 300 " y" A_ScreenHeight -35, Image upload progress 181 | img := ComObjCreate("WIA.ImageFile") 182 | For k, v In input 183 | { 184 | FileGetSize, fileSize, % v.path 185 | If (ErrorLevel) 186 | { 187 | MsgBox, % "There was a problem accessing that file:`n" v.path "`nErrorLevel: " Errorlevel 188 | filtered++ 189 | Continue 190 | } 191 | Else If (filesize >= 10485760) 192 | { 193 | MsgBox, % "Skipping file " v.path " that is " filesize/1048576 "Mb, which is beyond Imgur's 10Mb limit for one file." 194 | filtered++ 195 | Continue 196 | } 197 | Try img.LoadFile(v.path) 198 | Catch, e 199 | { 200 | MsgBox, % "This was an invalid image or not an image file at all.`nFile: " v.path "`nError: " e "`nError message: " e.Message "`nError what: " e.What "`nError extra: " e.Extra "`nError file: " e.File "`nError line: " e.Line 201 | filtered++ 202 | Continue 203 | } 204 | data := img.FileData.BinaryData 205 | httpObj[++trueIndex] := ComObjCreate("WinHttp.WinHttpRequest.5.1") 206 | ;httpObj[trueIndex].Open("POST", "https://api.imgur.com/3/upload") 207 | If (proxyEnable) 208 | ; { 209 | httpObj[trueIndex].SetProxy(2, proxyServer) 210 | If (tempScreenshot && !v.dnd) ; User specified to delete the local screenshot's file after uploading it. 211 | FileDelete, % v.path 212 | } 213 | 214 | filtered := trueIndex := 0 215 | While (httpObj.Length()) 216 | { 217 | trueIndex := (++trueIndex > httpObj.Length() ? trueIndex - httpObj.Length() : trueIndex++) 218 | 219 | 220 | } 221 | 222 | 223 | For k, v in imgURLs 224 | If (clipURL != 1) 225 | Run, % v 226 | If (clipURL) 227 | Clipboard := arr2ASV(imgURLs) 228 | Gui, Destroy 229 | Critical, Off 230 | 231 | 232 | 233 | } 234 | 235 | 236 | arr2ASV(arr, separator := " ") ; Parses the input array and outputs it's values as a string with anchor-separated values. 237 | { 238 | For k, v In arr 239 | var ? var .= separator v : var := v 240 | Return var 241 | } 242 | 243 | isThereAnotherInstance() ; Thanks to: GeekDude http://www.autohotkey.com/board/user/10132-geekdude/ 244 | { 245 | DetectHiddenWindows, On 246 | WinGet, wins, List, ahk_class AutoHotkey 247 | Loop, %wins% 248 | { 249 | WinGetTitle, win, % "ahk_id " wins%A_Index% 250 | If (RegExReplace(win, "^(.*) - AutoHotkey v[0-9\.]+$", "$1") == A_ScriptFullPath) 251 | { 252 | WinGet, wpid, PID, % "ahk_id " wins%A_Index% 253 | If (wpid != DllCall("GetCurrentProcessId")) 254 | Return wpid 255 | } 256 | } 257 | DetectHiddenWindows, Off 258 | Return 0 259 | } 260 | 261 | ;{ GDI+ functions 262 | 263 | Gdip_Startup() 264 | { 265 | If !(DllCall("GetModuleHandle", "Str", "gdiplus", ptr)) 266 | DllCall("LoadLibrary", "Str", "gdiplus") 267 | VarSetCapacity(si, A_PtrSize = 8 ? 24 : 16, 0), si := Chr(1) 268 | DllCall("gdiplus\GdiplusStartup", ptr "*", pToken, ptr, &si, ptr, 0) 269 | Return pToken 270 | } 271 | 272 | CreateDIBSection(w, h, hdc = "") 273 | { 274 | hdc2 := hdc ? hdc : DllCall("GetDC", ptr, 0) 275 | VarSetCapacity(bi, 40, 0) 276 | NumPut(w, bi, 4, "UInt"), NumPut(h, bi, 8, "UInt"), NumPut(40, bi, 0, "UInt"), NumPut(1, bi, 12, "ushort"), NumPut(0, bi, 16, "UInt"), NumPut(32, bi, 14, "ushort") 277 | hbm := DllCall("CreateDIBSection", ptr, hdc2, ptr, &bi, "UInt", 0, ptr "*", 0, Ptr, 0, "UInt", 0, ptr) 278 | If !(hdc) 279 | DllCall("ReleaseDC", ptr, 0, ptr, hdc2) 280 | Return hbm 281 | } 282 | 283 | Gdip_DrawLines(pGraphics, pPen, Points) 284 | { 285 | StringSplit, Points, Points, | 286 | VarSetCapacity(PointF, 8 * Points0) 287 | Loop, % Points0 288 | { 289 | StringSplit, Coord, Points%A_Index%, `, 290 | NumPut(Coord1, PointF, 8 * (A_Index - 1), "Float"), NumPut(Coord2, PointF, (8 * (A_Index - 1)) + 4, "Float") 291 | } 292 | Return DllCall("gdiplus\GdipDrawLines", ptr, pGraphics, ptr, pPen, ptr, &PointF, "Int", Points0) 293 | } 294 | 295 | UpdateLayeredWindow(hwnd, hdc, x = "", y = "", w = "", h = "", Alpha = 255) 296 | { 297 | If ((x != "") && (y != "")) 298 | VarSetCapacity(pt, 8), NumPut(x, pt, 0, "UInt"), NumPut(y, pt, 4, "UInt") 299 | If ((w = "") || (h = "")) 300 | WinGetPos,,, w, h, ahk_id %hwnd% 301 | Return DllCall("UpdateLayeredWindow", ptr, hwnd, ptr, 0, ptr, ((x = "") && (y = "")) ? 0 : &pt, "Int64*", w | h << 32, ptr, hdc, "Int64*", 0, "UInt", 0, "UInt*", Alpha << 16 | 1 << 24, "UInt", 2) 302 | } 303 | 304 | Gdip_BitmapFromScreen(screen) 305 | { 306 | If (SubStr(screen, 1, 5) = "hwnd:") 307 | { 308 | screen := SubStr(screen, 6) 309 | If !(WinExist("ahk_id " screen)) 310 | Return -2 311 | WinGetPos,,, w, h, ahk_id %screen% 312 | x := y := 0 313 | hhdc := DllCall("GetDCEx", ptr, screen, ptr, 0, "Int", 3) 314 | } 315 | Else If (screen&1 != "") 316 | { 317 | Sysget, M, Monitor, %screen% 318 | x := MLeft, y := MTop, w := MRight - MLeft, h := MBottom - MTop 319 | } 320 | Else 321 | { 322 | StringSplit, S, screen, | 323 | x := S1, y := S2, w := S3, h := S4 324 | } 325 | If ((x = "") || (y = "") || (w = "") || (h = "")) 326 | Return -1 327 | chdc := DllCall("CreateCompatibleDC", ptr, 0), hbm := CreateDIBSection(w, h, chdc), obm := DllCall("SelectObject", ptr, chdc, ptr, hbm), hhdc := hhdc ? hhdc : DllCall("GetDC", ptr, 0) 328 | DllCall("gdi32\BitBlt", ptr, chdc, "Int", 0, "Int", 0, "Int", w, "Int", h, ptr, hhdc, "Int", x, "Int", y, "UInt", 0x00CC0020) 329 | DllCall("ReleaseDC", ptr, 0, ptr, hhdc) 330 | DllCall("gdiplus\GdipCreateBitmapFromHBITMAP", ptr, hbm, ptr, 0, ptr "*", pBitmap) 331 | DllCall("SelectObject", ptr, chdc, Ptr, obm), DllCall("DeleteObject", ptr, hbm), DllCall("DeleteDC", ptr, hhdc), DllCall("DeleteDC", ptr, chdc) 332 | Return pBitmap 333 | } 334 | 335 | Gdip_SaveBitmapToFile(pBitmap, sOutput, quality = 100) 336 | { 337 | SplitPath, sOutput,,, Extension 338 | If Extension Not In BMP,DIB,RLE,JPG,JPEG,JPE,JFIF,GIF,TIF,TIFF,PNG 339 | Return -1 340 | DllCall("gdiplus\GdipGetImageEncodersSize", "UInt*", nCount, "UInt*", nSize) 341 | VarSetCapacity(ci, nSize) 342 | DllCall("gdiplus\GdipGetImageEncoders", "UInt", nCount, "UInt", nSize, ptr, &ci) 343 | If !(nCount && nSize) 344 | Return -2 345 | If (A_IsUnicode) 346 | { 347 | StrGet_Name := "StrGet" 348 | Loop, % nCount 349 | { 350 | sString := %StrGet_Name%(NumGet(ci, (idx := (48 + 7 * A_PtrSize) * (A_Index - 1)) + 32 + 3 * A_PtrSize), "UTF-16") 351 | If !(InStr(sString, "*." Extension)) 352 | Continue 353 | pCodec := &ci + idx 354 | Break 355 | } 356 | } 357 | Else 358 | { 359 | Loop, % nCount 360 | { 361 | Location := NumGet(ci, 76 * (A_Index - 1) + 44) 362 | nSize := DllCall("WideCharToMultiByte", "UInt", 0, "UInt", 0, "UInt", Location, "Int", -1, "UInt", 0, "Int", 0, "UInt", 0, "UInt", 0) 363 | VarSetCapacity(sString, nSize) 364 | DllCall("WideCharToMultiByte", "UInt", 0, "UInt", 0, "UInt", Location, "Int", -1, "Str", sString, "Int", nSize, "UInt", 0, "UInt", 0) 365 | If !(InStr(sString, "*." Extension)) 366 | Continue 367 | pCodec := &ci + 76 * (A_Index - 1) 368 | Break 369 | } 370 | } 371 | If !(pCodec) 372 | Return -3 373 | If Extension in JPG,JPEG,JPE,JFIF 374 | { 375 | quality := (quality < 0) ? 0 : ((quality > 100) ? 100 : quality) 376 | DllCall("gdiplus\GdipGetEncoderParameterListSize", ptr, pBitmap, ptr, pCodec, "UInt*", nSize) 377 | VarSetCapacity(EncoderParameters, nSize, 0) 378 | DllCall("gdiplus\GdipGetEncoderParameterList", ptr, pBitmap, ptr, pCodec, "UInt", nSize, ptr, &EncoderParameters) 379 | Loop, % NumGet(EncoderParameters, "UInt") 380 | { 381 | elem := (24 + (A_PtrSize ? A_PtrSize : 4)) * (A_Index - 1) + 4 + (pad := A_PtrSize = 8 ? 4 : 0) 382 | If ((NumGet(EncoderParameters, elem +1 6, "UInt") = 1) && (NumGet(EncoderParameters, elem + 20, "UInt") = 6)) 383 | { 384 | p := elem + &EncoderParameters - pad - 4 385 | NumPut(quality, NumGet(NumPut(4, NumPut(1, p + 0) + 20, "UInt")), "UInt") 386 | Break 387 | } 388 | } 389 | } 390 | If !(A_IsUnicode) 391 | { 392 | nSize := DllCall("MultiByteToWideChar", "UInt", 0, "UInt", 0, ptr, &sOutput, "Int", -1, ptr, 0, "Int", 0) 393 | VarSetCapacity(wOutput, nSize * 2) 394 | DllCall("MultiByteToWideChar", "UInt", 0, "UInt", 0, ptr, &sOutput, "Int", -1, ptr, &wOutput, "Int", nSize) 395 | VarSetCapacity(wOutput, -1) 396 | If !(VarSetCapacity(wOutput)) 397 | Return -4 398 | E := DllCall("gdiplus\GdipSaveImageToFile", ptr, pBitmap, ptr, &wOutput, ptr, pCodec, "UInt", p ? p : 0) 399 | } 400 | Else 401 | E := DllCall("gdiplus\GdipSaveImageToFile", ptr, pBitmap, ptr, &sOutput, ptr, pCodec, "UInt", p ? p : 0) 402 | Return E ? -5 : 0 403 | } 404 | ;} 405 | 406 | 407 | --------------------------------------------------------------------------------