aputty Posted September 10, 2019 Share Posted September 10, 2019 Hi, I am able to use the workflows to open a URL. However, I want to be able to open a URL in the same tab that is currently being viewed/loaded. how do I achieve this? Thanks. Avi Link to comment
deanishe Posted September 10, 2019 Share Posted September 10, 2019 1 hour ago, aputty said: how do I achieve this? Step one would be telling us which browser you're talking about Link to comment
aputty Posted September 10, 2019 Author Share Posted September 10, 2019 sorry. Chrome but hoping that the solution would work for all browsers. Link to comment
deanishe Posted September 10, 2019 Share Posted September 10, 2019 25 minutes ago, aputty said: hoping that the solution would work for all browsers No way, José. You can tell any application to open something in a universal way, as that's simply how macOS talks to applications. As soon as you want to dictate how an application should open something, you're talking about application-specific APIs. I mean, there can't be a universal way to say "open this in the active tab" when many applications don't even have tabs. To answer your question, this script will open the given URL in the active Chrome tab. Put it in a Run Script action with Language = /usr/bin/osascript (AS) and with input as argv. on run argv tell application "Google Chrome" to set URL of active tab of front window to (first item of argv) end run Be aware, this is an extraordinarily rudimentary script. If there's no Chrome window to open the URL in, it will fail. I'll leave fixing that case up to you 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