notion-search-alfred-workflow icon indicating copy to clipboard operation
notion-search-alfred-workflow copied to clipboard

Add Support to Open Search Results in New Window (Notion for MacOS)

Open nelsonestrada5 opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. I constantly have multiple Notion windows open at the same time, but when i usw the ns alfred workflow, the selected result is opened in the most recently used Notion window (which is typically a notion page I want open). It would be great to have the ability to open search results in a new tab or window so that they can be complementary to the existing open tabs.

Describe the solution you'd like The ideal solution would add another Workflow Environment Variable that is a boolean (e.g. openResultInNewWindow) that can be set by the user. When the user sets this to True, the search result selected would open a new window in the Notion Mac app.

Describe alternatives you've considered This request, of course, works out of the box when useDesktopClient is set to false, but I much prefer the Notion Mac app.

Additional context Thank you SO much for the workflow, it's already been such a productivity hack and a timesaver, so thank you!!

nelsonestrada5 avatar Dec 15 '22 19:12 nelsonestrada5

Great suggestion and thanks for raising, I'm not sure if this is possible though. The workflow provides Alfred with a URL to open, when useDesktopClient is True the URL is notion://www.notion.so/[page]. Alfred/MacOs takes care of the rest and uses that info to open the Notion desktop which is presumable registered with notion://

Someone with more knowledge may be able to say if it is possible to tell the Notion app at the same time, to open a new window

wrjlewis avatar Jan 10 '23 11:01 wrjlewis

You can open a page in a new tab using AppleScript (Run NSAppleScript):

on alfred_script(q)
  tell application "Notion" to activate
  tell application "System Events"
	tell process "Notion"
		-- Click "New Tab" in the "File" menu
		click menu item "New Tab" of menu "File" of menu bar 1
		
		-- Delay to ensure the new tab is opened
		delay 0.9
		
		-- Open the specific link in the new tab
		tell application "Notion" to open location q
	end tell
end tell
end alfred_script

The q is the URL of the page (notion://www.notion.so/[page]).

svenko99 avatar May 09 '24 20:05 svenko99

That is good to know, thank you. I'll test this out and hopefully include in a future release.

wrjlewis avatar May 16 '24 10:05 wrjlewis

Recently Notion has updated the functionality of opening a new tab. To make sure the provided script works the New Tab Search must be toggled off.

Screenshot 2024-06-15 at 12 20 29@2x

svenko99 avatar Jun 15 '24 10:06 svenko99