0

I have a shortcut for an Automator Workflow that runs a python file on a selected text. That is, I highlight a text say "(\alpha)" then press Cmd+Shift+U and it automatically replaces the highlighted string "(\alpha)" to its unicode counterpart "α".

This shortcut works perfectly when I use it on most applications: For example, if I write "(\alpha)" in the address bar in Safari and use this shortcut, it works perfectly.

However, I am unable to use it in Visual Studio Code. I have selected the "any application" toggle in Automator Workflow so I don't think that is the issue. In fact, rarely but sometimes, the shortcut works perfectly in Visual Studio Code on its own but I am not able to get it run consistently.

How can I get the Automator Workflow to receive input from Visual Studio Code?

10
  • I don't know Visual Studio in detail, but does it offer a way to run an external command on a text selection? You could just call your Python script directly then. Commented Jul 20, 2025 at 16:55
  • @nohillside I would imagine that it does, but I was hoping to just learn the Automator way since I have bunch of other Automator workflows that I would like to run in Visual Studio Code Commented Jul 20, 2025 at 17:00
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Jul 20, 2025 at 21:24
  • There is the automator command which can be run from any shell. Would this help? Commented Jul 20, 2025 at 21:33
  • @nohillside That is precisely what I am using currently but it doesn't automatically replace the text. Commented Jul 21, 2025 at 11:47

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.