Jump to content

Recommended Posts

This Alfred workflow opens a new Notion window when supplied the keyword "nn".

 

The Github repository for the workflow can be found here. To download the Alfred workflow directly, click this link.

 

This workflow was made for Mac OS using Apple script (which you can see in the Github repo).

Edited by eupraxia
Link to comment
  • 2 weeks later...
Posted (edited)
On 5/5/2022 at 7:44 AM, heyjoetofu said:

Thanks! But does it need to open the Public Example page in the browser?

 

Edit: I've since changed the workflow to simply open a duplicate of whatever page you're on. This solved the issue of the prior page navigating "back" one page when the new page was opened.

 

Oh, is the workflow opening Notion to the web browser as opposed to the Mac app?

 

I may have forgotten to explain this part. See if this works for you. If it does, I'll update the workflow accordingly :)

 

I've created my own public example page in Notion, so you can test the workflow before plugging in your own link. This will allow us to make sure it's working before you customise it to open the Notion page that you want it to open.

 

The code in the Apple script is as follows, this time with my freshly created (and public) example page:
 

on alfred_script(q)

	tell application "Notion" to activate
	tell application "System Events" to keystroke "n" using {command down, shift down}
	tell application "Notion" to open location {"notion://www.notion.so/tommarshall/Example-c8c0ea70bd094a82a40f1ee3c11c4169"}

end alfred_script

 

Go into the workflow on Alfred, right click on the "Run NSAppleScript" object, click "Configure Object...", delete the entire existing script, and replace it with the code above.

 

Once you've done that, when you run the shortcut (i.e. without modifying it at all) it should open a page called "Example" with a brief note of jubilation that the workflow appeared to work. If that page successfully opened in Notion—yay! If you run into any issues, please let me know!

 

Also, in case I wasn't clear in the README, this is how you paste in your own link:

 

To make the shortcut open your Notion page within Notion's Mac App (rather than in your browser), simply copy the link to your Notion page (which is just a regular old URL), delete the `https` at the beginning of the URL, and replace the `https` with `notion` so that you end up with a link the beginning of which looks like the link in the code block above.

 

That's literally all you need to do--replace the link with your own, and replace `https` with `notion`, and it should work. If it doesn't, then I've screwed up 🥴.

Edited by eupraxia
Link to comment

Ah, gotcha. Sorry, I absolutely didn't make the connection to not only change the https:// to notion:// but to change the link as well. For some reason I assumed the example page had something to do with functionality. 🤦‍♂️ (Weirdly enough the example page opened in the browser AND the app when I first changed the https-link to a notion-link, so that was irritating as well).

 

Thanks for clarifying, everything's working perfectly now!

Link to comment
Posted (edited)
21 hours ago, heyjoetofu said:

Ah, gotcha. Sorry, I absolutely didn't make the connection to not only change the https:// to notion:// but to change the link as well. For some reason I assumed the example page had something to do with functionality. 🤦‍♂️ (Weirdly enough the example page opened in the browser AND the app when I first changed the https-link to a notion-link, so that was irritating as well).

 

Thanks for clarifying, everything's working perfectly now!

 

Not at all—it’s the maker’s job to clearly communicate how their thing works!

 

Glad all working smoothly! If you like it, you might like some of my other shortcuts (they’re all pretty simple and similar in spirit). They’re all on my GitHub page :)

 

Edited by eupraxia
Link to comment

Thank you, eupraxia, for this fantastic time-saving workflow. It works great!
 

However, is it possible to force the Notion to open the new window in the current workspace Desktop? This could be a mac issue rather than something specific to Notion. 
 

So, I have multiple Desktops and have Notion loaded in some of these. If I'm working on a particular workspace and use your workflow, it will open Notion in the last workspace that Notion used. Moreover, it will cause the already open notion page to switch to the new page. I just opened and loaded up another Notion copy with the intended page. 

Sorry if the above is not clear; I'm new to Alfred. To see what I'm referring to:
1) Open Notion in Desktop 1 with any page
2) Go to Desktop 2 from the mission control, and use the workflow to load Notion with the intended page
 

You will be switched (automatically) to Desktop one, where now you have the old notion page and the new notion page both set to the intended page. 

I have to click back (or cmd+[) on the previous notion window to set it back to what it was and then drag the newly opened notion window to the Desktop 2. 

Link to comment

Glad to hear it's on the right path to being useful to you, optimalflow!

 

On 5/12/2022 at 1:17 PM, optimalflow said:

So, I have multiple Desktops and have Notion loaded in some of these. If I'm working on a particular workspace and use your workflow, it will open Notion in the last workspace that Notion used. Moreover, it will cause the already open notion page to switch to the new page. I just opened and loaded up another Notion copy with the intended page. 

Sorry if the above is not clear; I'm new to Alfred. To see what I'm referring to:
1) Open Notion in Desktop 1 with any page
2) Go to Desktop 2 from the mission control, and use the workflow to load Notion with the intended page
 

You will be switched (automatically) to Desktop one, where now you have the old notion page and the new notion page both set to the intended page. 

I have to click back (or cmd+[) on the previous notion window to set it back to what it was and then drag the newly opened notion window to the Desktop 2. 

 

There's two problems I'm picking up on here:

A) when you use the shortcut, it pings back to the desktop where the Notion window is already open rather than opening it in situ on the desktop you're currently viewing.

B) the Notion page you have already open when you use the shortcut reverses to a prior page

 

For A: have you checked your settings in System Preferences > Mission Control ? There should be a box there that you can toggle on and off which says "When switching to an application, switch to a Space with open windows for the application. Try unticking that box, and see if problem persists.

 

For B: I've updated the shortcut on Github, which appears to have fixed the issue. Now, it will open the page you were on before, but it won't do anything to your currently open window. Let me know if this works.

 

When I have some time, I'll try and figure out a way to make it customisable so that it always opens at a particular page pre-designated by the user--whatever the user considers their own personal "home" page as far as this shortcut is concerned.

 

Hope this helps!

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...