Skip to content

Automate text insertion #1063

Closed Answered by gdh1995
limaceous-bushwhacker asked this question in Q&A
Discussion options

You must be logged in to vote

Well, it's quite complex, though indeed possible in Vimium C.

  1. Firstly, you need a custom search engine from a keyword to vimium://run/<runKey-commands-with-$s>
  2. Then the problem becomes to "how to write the <runKey-commands-with-$s>"
  3. Its 1st command should be 4g0
  4. To do "press Ctrl+I", its 2nd command should be dispatchEvent#ctrlKey&key=i
    1. dispatchEvent will returns a "failure" if there's no currently focused element, so ( and ) is necessary to ignore its result
  1. To ensure the page has enough time to show a text area, you may need a 3rd command of 300wait (to wait for an extra 300ms)
    1. just a tip: a next command will run in 50ms by default, so a+300wait+b means to run b in 50+300+5…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@limaceous-bushwhacker
Comment options

Answer selected by limaceous-bushwhacker
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants