Sample code for try! Swift 2024 presentation
Sample code for retrieving text from any application using the Accessibility API.
With the text selected, press the shortcut key Command + Control + A. A floating window with a text field will appear so you can enter any prompt to the AI assistant.
chat_assistant.mp4
assistant_safari.mp4
Sample code for rewriting text in any application using the Accessibility API.
Launch TextEdit.app and enter text freely. You can enter a prompt to the AI assistant after /assist
.
The result returned by the AI assistant is directly inserted afterwards.
inlineassistant.mp4
Translate comic lines.
Launch any comic reader application. Press the crosshair button to enter capture mode. Click on a page in the comic reader application to capture a screenshot and let the AI assistant translate the extracted text using OCR.
comictranslator.mp4
Dumps the AXUIElement
at the mouse cursor position. Learn how to use the basic accessibility API and how to convert values.
elementinspector.mp4
Carbon API based global hotkey implementation.