@@ -384,7 +384,9 @@ will work even when the hints are off.
384
384
#### Save References
385
385
386
386
- ` mark <target> as <word> ` : Saves a reference to the element with the specified
387
- hint and assign it to the specified word.
387
+ hint and assigns it to the specified word.
388
+ - ` mark this as <word> ` : Saves a reference to the focused element and assigns it
389
+ to the specified word.
388
390
- ` mark show ` : Shows the visible saved references current in the page.
389
391
- ` mark clear <word> ` : Remove the reference corresponding to the specified word.
390
392
@@ -400,7 +402,7 @@ In order to use the saved references in scripting you need to use the talon
400
402
action ` user.rango_run_action_on_reference ` . This action accept two arguments:
401
403
the name of the action and the name of the reference.
402
404
403
- Following is a simple example of command that clicks the element with the
405
+ Following is a simple example of a command that clicks the element with the
404
406
reference ` edit ` :
405
407
406
408
``` talon
@@ -414,6 +416,47 @@ use references. These will be active when editing `.talon` files.
414
416
- ` focus rango mark <word> `
415
417
- ` hover rango mark <word> `
416
418
419
+ ### Fuzzy Search Elements
420
+
421
+ Similar to custom references you can also target elements by their text content
422
+ using fuzzy search. This can also be used for scripting purposes with the
423
+ advantage that there is no need to previously save a reference to the element.
424
+
425
+ #### Using Fuzzy Search Directly to Run Actions on Elements
426
+
427
+ - ` follow <text> ` : Click the element that better matches the provided text. It
428
+ prioritizes elements within the viewport. Any element within the viewport will
429
+ have priority over other elements outside of the viewport with better
430
+ fuzziness score.
431
+ - ` button <text> ` : Click the element that better matches the provided text. It
432
+ doesn't take into account if the element is within or outside the viewport. It
433
+ will simply click the element in the document with the best fuzziness score.
434
+ - ` focus text <text> ` : Focus the element that better matches the provided text.
435
+ It prioritizes elements within the viewport.
436
+ - ` hover text <text> ` : Hover the element that better matches the provided text.
437
+ It prioritizes elements within the viewport.
438
+
439
+ #### Scripting Using Fuzzy Search
440
+
441
+ In order to use fuzzy search in scripting you need to use the talon action
442
+ ` user.rango_run_action_on_text_matched_element ` . This action accepts three
443
+ arguments: the name of the action, the text searched and whether to prioritize
444
+ elements within the viewport or not (optional, defaults to false).
445
+
446
+ Following is a simple example of a command that clicks the element that better
447
+ matches the text "edit" anywhere in the document.
448
+
449
+ ``` talon
450
+ edit this: user.rango_run_action_on_text_matched_element("clickElement", "edit", false)
451
+ ```
452
+
453
+ There are also a few talon helpers that will make easier to create commands
454
+ using fuzzy search. These will be active when editing ` .talon ` files.
455
+
456
+ - ` click rango text <text> `
457
+ - ` focus rango text <text> `
458
+ - ` hover rango text <text> `
459
+
417
460
### Modify Hints Size
418
461
419
462
- ` hint bigger ` : Increase the size of the hints.
@@ -532,43 +575,43 @@ In [this page](https://forvo.com/word/define/#en) we have this section which
532
575
unfortunately doesn't show any hints.
533
576
534
577
<p align =" left " >
535
- <img src="images/screenshot-custom-hints-1.png" height=70px ">
578
+ <img src =" images/screenshot-custom-hints-1.png " alt = " " >
536
579
</p >
537
580
538
581
Now we use the command ` hint extra ` to greedily display hints.
539
582
540
583
<p align =" left " >
541
- <img src="images/screenshot-custom-hints-2.png" height=70px ">
584
+ <img src =" images/screenshot-custom-hints-2.png " alt = " " >
542
585
</p >
543
586
544
587
If we wanted to show hints for the gray links we can issue the command
545
588
` include cap each and cap drum ` , which marks in green the hints that will be
546
589
included.
547
590
548
591
<p align =" left " >
549
- <img src="images/screenshot-custom-hints-3.png" height=70px ">
592
+ <img src =" images/screenshot-custom-hints-3.png " alt = " " >
550
593
</p >
551
594
552
595
Since the result is not exactly what we want and there are still hints missing
553
596
we use the command ` some more ` .
554
597
555
598
<p align =" left " >
556
- <img src="images /screenshot-custom-hints-4.png" height=70px ">
599
+ <img src =" mimages /screenshot-custom-hints-4.png" alt = " " >
557
600
</p >
558
601
559
602
Now there are more hints showing but they're not the ones we want. We issue the
560
603
command ` some more ` again to see if that helps.
561
604
562
605
<p align =" left " >
563
- <img src="images/screenshot-custom-hints-5.png" height=70px ">
606
+ <img src =" images/screenshot-custom-hints-5.png " alt = " " >
564
607
</p >
565
608
566
609
The hints marked for inclusion now are exactly the ones we want. We could
567
610
continue including more custom hints using the ` include ` command again but for
568
611
the moment we leave it like that and save with ` custom hints save ` .
569
612
570
613
<p align =" left " >
571
- <img src="images/screenshot-custom-hints-6.png" height=330px ">
614
+ <img src =" images/screenshot-custom-hints-6.png " alt = " " >
572
615
</p >
573
616
574
617
Now the extra hints disappear and we are left with the custom hints that we just
@@ -600,6 +643,14 @@ Here is a summary of all the commands for customizing hints:
600
643
inclusion/exclusion so that they render by default.
601
644
- ` custom hints reset ` : Remove any previously included/excluded custom hints.
602
645
646
+ Custom hints can also be edited, added or removed from the settings page.
647
+
648
+ #### Hiding a Particular Hint
649
+
650
+ On occasions a hint might be obscured by another hint that is stacked on top of
651
+ the first one. For those occasions you can use the command ` hide <target> ` to
652
+ hide the hint on top.
653
+
603
654
## Known Issues and Limitations
604
655
605
656
There is currently no way to open a pure CSS dropdown menu like the "hover" menu
0 commit comments