A tailored Alfred Workflow that performs tasks using notion-py
within the context of a specific Notion Template as described in this blog post.
There is a bit of setup required to make this project work as intended.
- Have a Notion account
- Have Alfred 3+ with access to workflows (i.e., powerpack)
- Have Python 3 installed on the system
- Have Specific Notion Template as described in this blog post
- Your Notion Token
- URLs for Several Notion Object
Create a Blank Workflow and dump the contents of this repository into it.
There are certain Python dependencies that are required for the scripts to work correctly. You need to navigate to the workflow's directory so that you can execute pip3 install -r requirements.txt
from your terminal. Alternatively, you can manually install what is defined in the ./requirements.txt
.
The first thing you'll need to do is get your Notion Token (156 character value) from your browser's cookies. Depending on what browser you are using this process will vary slightly. The following diagram demonstrates how to find it using Chrome on MacOS.
We need to identify the Notion URLs for the:
- Tags Database
- Wins Database
- Tasks Database
- Year Page
These are can be acquired by finding the correct resource in your Notion and using the Copy Link found in the context menu (i.e., right click or the left-clicking ...
).
Given the information we've taken note of in the last 2 sections, we can now configure our data files.
- Find
./data/tags.sample.json
, and rename to./data/tags.json
. - Find
./data/config.sample.json
, and rename to./data/config.json
. - Fill the value out in
./data/config.json
with the Notion Token and Notion URLs:
{
"NOTION_TOKEN": "your-notion-token",
"TAGS_DATABASE_URL": "your-notion-tags-database-url",
"TASKS_DATABASE_URL": "your-notion-tasks-database-url",
"WINS_DATABASE_URL": "your-notion-wins-database-url",
"YEAR_PAGE_URL": "your-notion-year-page-url"
}
Note: I know that this is a rather unconventional approach for configurations with an Alfred workflow, but it is what worked best for me. Later on, I might switch it up to something more conventional.
This keyword will open Notion to the current week.
- The week page needs to exist.
- Notion will become the forefront application and will open the current week.
- After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
This keyword will open Notion to the current day.
- The day page needs to exist under the current week.
- Notion will become the forefront application and will open the current day.
- After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
This keyword allows you to create a new tag in your tags database.
- After the tag has been added, a secondary action will run
:update
), updating the locally cached data file holding our tags. - You will likely want to add an icon after the fact on the newly added tag.
This keyword allows you to update your local tags data file with what your database has.
- This is done so we have a local cache to speed things up.
- After making a new tag, this is done this automatically.
This keyword allows you to create a new win in your wins database.
- You can optionally open the Notion page for this win if you
cmd + enter
when entering the title.- After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
- After entering the win's title you will be able to add multiple tags.
- You can finish adding tags by selecting the
Done
option.
- You can finish adding tags by selecting the
This keyword allows you to create a new task in your tasks database.
- You can optionally open the Notion page for this task if you
cmd + enter
when entering the title.- Notion will become the forefront application.
- After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
- After entering the task's title you will be able to add multiple tags.
- You can finish adding tags by selecting the
Done
option.
- You can finish adding tags by selecting the
- After entering the task's tags you can select the status.
This keyword allows you to search your tasks, and be able to open it in Notion or change its status.
- Search results are based on the view of the
TASKS_DATABASE_URL
.- Ideally, you would have this being a view on the master task database that matches the filters of your current day's Linked Database of tasks. This little optimization is done for speed reasons.
- Searches the word boundaries of title/tags/status of a task.
- When selecting a task it will open its Notion page.
- Notion will become the forefront application.
- After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
- You can optionally select the task with
cmd + enter
to change its status.- If the status changes to
Completed
theCompleted On
attribute of the task will be updated to the current time.
- If the status changes to
This keyword allows you to append a text block at the end of your current day's notes section.