Jump to content

Multiple windows with Launch Apps Action?


Recommended Posts

6 hours ago, aFan said:

Can't figure out a way to open 2 windows in the workflow. Is it possible?

 

Not, directly, no. There’s no universal way to tell an application to open a new window (some apps don’t even support multiple windows).


You’ll have to specifically tell whichever browser you’re using to open two windows using whatever method it makes available. There might be an AppleScript API, or a flag you can pass to /usr/bin/open, or you might have to simulate keypresses to call the app's keyboard shortcuts (⌘N, ⌘L, ⌘V etc.). All depends on which application you’re talking about.

Link to comment

This AppleScript opens each of the specified URLs in a new window. Put it in a Run Script with Language = /usr/bin/osascript (AS)

 

-- URLs to open in new windows
property _urls : {"https://www.alfredapp.com", "https://www.alfredforum.com"}

on run {}
	tell application "Brave Browser"
		repeat with _url in _urls
			set _win to (make new window)
			set URL of active tab of _win to _url
		end repeat
	end tell
end run

 

Link to comment

Another way to do it for Brave, with /bin/bash as the language:


open -na 'Brave Browser' --args --new-window 'https://example.com'
open -na 'Brave Browser' --args --new-window 'https://alfredapp.com' 'https://www.alfredforum.com'

 

That’s useful for defining different tabs for each window.

Link to comment
3 hours ago, vitor said:

Another way to do it for Brave, with /bin/bash as the language:

 


open -na 'Brave Browser' --args --new-window 'https://example.com'
open -na 'Brave Browser' --args --new-window 'https://alfredapp.com' 'https://www.alfredforum.com'

 

 

That’s useful for defining different tabs for each window.

Thanks! That works. First time putting together this sort of workflow and want to make sure it's correct. Is this the correct setup? language: /bin/bash, "with input as argue", running instances "concurrently"?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...