erusev Posted February 22, 2023 Share Posted February 22, 2023 (edited) In this example here, if my workflow is designed to work w/ Chrome, it should get Create New Topic ... as this is the active window in Chrome. Edited February 22, 2023 by erusev Link to comment
Stephen_C Posted February 22, 2023 Share Posted February 22, 2023 I can't experiment because I don't use Chrome, but doesn't the Automation TaskGet Current Chromium Browser Tab return what you need? (Sorry if I have misunderstood.) Stephen Link to comment
erusev Posted February 22, 2023 Author Share Posted February 22, 2023 (edited) Hi Stephen, no, because it needs to be able to work with any macOS app, not just Chrome -- for the particular workflow I have in mind, I need it to work with VSCode -- I should have used VSCode as an example to avoid confusion. Edited February 22, 2023 by erusev Link to comment
vitor Posted February 22, 2023 Share Posted February 22, 2023 (edited) Are you looking to get the title of the window of an arbitrary app, only from VSCode, or from the frontmost app? Each is a slightly different approach. Edited February 22, 2023 by vitor Link to comment
erusev Posted February 23, 2023 Author Share Posted February 23, 2023 I'm looking for the window title of VSCode from any context. Ex: I could be in the browser, and the workflow should be able to get the title of the window of VSCode. Link to comment
vitor Posted February 23, 2023 Share Posted February 23, 2023 In a Run Script with Language set to /usr/bin/osascript (JavaScript), make the Script: Application("System Events").processes["Code"].windows[0].name() JXA always outputs a newline, so strip whitespaces if you need to. I’ll have a further think about this for Automation Tasks. erusev 1 Link to comment
erusev Posted February 23, 2023 Author Share Posted February 23, 2023 Awesome 🤩 That's exactly what I needed 😊 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