- Install Python if you don't have it already. You can download it from the official website: https://www.python.org/downloads/macos/
- Install the OpenAI library by running pip install OpenAI in your terminal.
- Open up Automator.
- Click File -> New and create a new Quick Action. You can name this action whatever you like, such as "Translate with OpenAI".
- Set "Workflow receives current" to "text in any application".
- Check the box for "Output replaces selected text".
- Drag the "Run Shell Script" action to the right side, and select "/usr/local/bin/python" or "/usr/local/bin/python3" as the shell depending on your Python version.
- Set "Pass input" to "stdin".
- Copy and paste the code from the translate.py file, and replace [YOUR OPENAI API KEY] with your OpenAI API Key. You can also change the language you wish to translate to.
- Save the Quick Action, and it should now show up as a right-click option when you select text in any application.
IvanLaraV/OpenAI-Automator-Translation
A simple Mac Automator script that allows you to select text and translate the selected text with OpenAI
PythonApache-2.0