Veniamin Posted March 27, 2023 Share Posted March 27, 2023 Hi all! I want to make shortcut (ex. Option+T) than opens Telegram app with search already opened (command+K shortcut in this app). First step is easy, but how to emulate shortcut fire as a part of Workflow? Tried apple script: Quote on alfred_script(q) tell application "System Events" key down command keystroke "k" key up command end tell end alfred_script It's give no result. Need a piece of advice 🙏 Link to comment
vitor Posted March 27, 2023 Share Posted March 27, 2023 (edited) Welcome @Veniamin, You don’t need AppleScript, Alfred has an object for sending key combos. But you might need a delay between launching the app and firing the combo, otherwise it will happen too soon and Telegram won’t register it. A better solution would be to tell Telegram to do the search (e.g. via its own AppleScript dictionary) but that depends on the Telegram app itself and if it is scriptable. Edited March 27, 2023 by vitor Link to comment
Veniamin Posted March 27, 2023 Author Share Posted March 27, 2023 @vitor Thanks for help! It works! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now