yqrashawn / GokuRakuJoudo

config karabiner with ease
GNU General Public License v3.0
1.14k stars 121 forks source link

How can I run shell and then type keys #148

Closed fjchen7 closed 2 years ago

fjchen7 commented 2 years ago

Here is my configuration

:templates {
  :open "open \"%s\""
}
{:des "launch"
  :rules [
    [:!Og [:open "/Applications/Alfred 4.app" :g :spacebar]}]
  ]
}

I want to open Alfred and then type g and spacebar in sequence. My configuration above doesn't work. How can I do it?

yqrashawn commented 2 years ago

karabiner won't execute each action synchronously, you need to use applescript to implement this. There're tons of examples on stackoverflow for

  1. running shell script with applescript
  2. pressing keys with applescript
  3. add delay between actions in applescript