Jordi Posted March 18, 2020 Share Posted March 18, 2020 I'd like to do the next: With a global hotkey (cmd + alt + *) open TuneIn (wich is already streaming) and "Toggle Play" in Playback menu. I create a workflow to open and show TuneIn but can't find the way to "send" the hotkey to activiate de menu option. Could you help me? Thx. Jordi. Link to comment
gjbrugman Posted January 5, 2021 Share Posted January 5, 2021 I would love to do the same thing. Is there somebody who could explain how to 'send' a command to an app? (in this case the tune in app) Link to comment
deanishe Posted January 5, 2021 Share Posted January 5, 2021 46 minutes ago, gjbrugman said: Is there somebody who could explain how to 'send' a command to an app? There isn't any one way to tell apps what to do. Like with anything else, it depends on how the thing you want to control allows you to control it (if it even does). Guys, if you have a question about a specific app or website, could you at least provide a link to it? Asking for help is cool, but leaving us to go find what it is you're talking about when you could easily point us right to it isn't. Link to comment
Jordi Posted January 5, 2021 Author Share Posted January 5, 2021 Hi there, if you take a look a little up you can read my original and well explained problem. gjbrugman just added his concern about de same problem. I think your answer as moderator maybe could be a little soft ;-) Happy New Year. Link to comment
Vero Posted January 5, 2021 Share Posted January 5, 2021 @Jordi To make things easier for others to help you out, here are a few suggestions of what you should include in a post calling out for help: The link to the app/site you're referring to (there are often more than one by the same name) and the exact version if you're referring to an app. Your workflow-in-progress to show what you've achieved so far (and so someone else can build upon what you've done rather than have to start from scratch) If you've taken the time to investigate whether the app has API documentation, links to anything relevant you can provide Any other information about what you've tried, what works and doesn't, etc... Moderators are giving their time to help the community, so the more information you provide, the more likely someone will be able to untangle what's missing and be able to help Cheers, Vero gjbrugman and Jordi 2 Link to comment
gjbrugman Posted January 5, 2021 Share Posted January 5, 2021 1 hour ago, deanishe said: There isn't any one way to tell apps what to do. Like with anything else, it depends on how the thing you want to control allows you to control it (if it even does). Guys, if you have a question about a specific app or website, could you at least provide a link to it? Asking for help is cool, but leaving us to go find what it is you're talking about when you could easily point us right to it isn't. Hello. Thank you. I understand what you are saying. This is the app we are referring to: https://cdn-desktop.tunein.com/release/TuneIn-1.19.0.dmg or https://tunein.com/ to go to the website. The workflow I have now, only starts the app. But it would be nice to toggle play/pauze. Maybe it isnt even possible, because the app itself doesnt have a shortcut key to use for that. Link to comment
deanishe Posted January 5, 2021 Share Posted January 5, 2021 Thanks. This AppleScript should "click" the right menu: tell application "TuneIn" to activate tell application "System Events" tell process "TuneIn" tell menu bar item 7 of menu bar 1 click click menu item "Toggle Play" of menu 1 end tell end tell end tell Run it in a Run Script Action with Language = "/usr/bin/osascript (AS)". Jordi and gjbrugman 1 1 Link to comment
gjbrugman Posted January 5, 2021 Share Posted January 5, 2021 13 minutes ago, deanishe said: Thanks. This AppleScript should "click" the right menu: tell application "TuneIn" to activate tell application "System Events" tell process "TuneIn" tell menu bar item 7 of menu bar 1 click click menu item "Toggle Play" of menu 1 end tell end tell end tell Run it in a Run Script Action with Language = "/usr/bin/osascript (AS)". Great, this works! Thank you! Ands I learned some thing about programming. This looks 'easy' Link to comment
deanishe Posted January 5, 2021 Share Posted January 5, 2021 (edited) 4 minutes ago, gjbrugman said: This looks 'easy' It's fairly straightforward to do when you have the application and Accessibility Inspector (part of Xcode). Edited January 5, 2021 by deanishe gjbrugman 1 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