bundleid com.wrjlewis.notion-search connections 7DD3BDE5-A157-42E5-9376-F681FB50A4EE destinationuid FCE03E9D-F992-4B21-9A77-E72D5130DF80 modifiers 0 modifiersubtext vitoclose destinationuid C4564BA3-C023-400E-AA4E-726CC734C91D modifiers 0 modifiersubtext vitoclose destinationuid 2A617635-BC53-4025-A598-0A8B1E6C434B modifiers 1048576 modifiersubtext Copy to clipboard vitoclose F7D08518-1D55-4B69-AE6C-198FA8628A43 destinationuid 0B599F73-39AE-445B-8B09-AA12331F953D modifiers 0 modifiersubtext vitoclose createdby Will Lewis description Instant Notion Search disabled name Notion Search objects config browser spaces url utf8 type alfred.workflow.action.openurl uid FCE03E9D-F992-4B21-9A77-E72D5130DF80 version 1 config alfredfiltersresults alfredfiltersresultsmatchmode 0 argumenttreatemptyqueryasnil argumenttrimmode 0 argumenttype 1 escaping 68 keyword ns queuedelaycustom 3 queuedelayimmediatelyinitially queuedelaymode 0 queuemode 1 runningsubtext Loading.. script python3 notion.py "{query}" scriptargtype 0 scriptfile notion.py subtext title Notion Search type 0 withspace type alfred.workflow.input.scriptfilter uid 7DD3BDE5-A157-42E5-9376-F681FB50A4EE version 3 config concurrently escaping 0 script # THESE VARIABLES MUST BE SET. SEE THE ONEUPDATER README FOR AN EXPLANATION OF EACH. readonly remote_info_plist='https://raw.githubusercontent.com/wrjlewis/notion-search-alfred-workflow/master/info.plist' readonly workflow_url='wrjlewis/notion-search-alfred-workflow' readonly download_type='github_release' readonly frequency_check='1' # FROM HERE ON, CODE SHOULD BE LEFT UNTOUCHED! function abort { echo "${1}" >&2 exit 1 } function url_exists { curl --silent --location --output /dev/null --fail --range 0-0 "${1}" } function notification { local -r notificator="$(find . -type f -name 'notificator')" if [[ -f "${notificator}" && "$(/usr/bin/file --brief --mime-type "${notificator}")" == 'text/x-shellscript' ]]; then "${notificator}" --message "${1}" --title "${alfred_workflow_name}" --subtitle 'A new version is available' return fi osascript -e "display notification \"${1}\" with title \"${alfred_workflow_name}\" subtitle \"A new version is available\"" } # Local sanity checks readonly local_info_plist='info.plist' readonly local_version="$(/usr/libexec/PlistBuddy -c 'print version' "${local_info_plist}")" [[ -n "${local_version}" ]] || abort 'You need to set a workflow version in the configuration sheet.' [[ "${download_type}" =~ ^(direct|page|github_release)$ ]] || abort "'download_type' (${download_type}) needs to be one of 'direct', 'page', or 'github_release'." [[ "${frequency_check}" =~ ^[0-9]+$ ]] || abort "'frequency_check' (${frequency_check}) needs to be a number." # Check for updates if [[ $(find "${local_info_plist}" -mtime +"${frequency_check}"d) ]]; then # Remote sanity check if ! url_exists "${remote_info_plist}"; then abort "'remote_info_plist' (${remote_info_plist}) appears to not be reachable." fi readonly tmp_file="$(mktemp)" curl --silent --location --output "${tmp_file}" "${remote_info_plist}" readonly remote_version="$(/usr/libexec/PlistBuddy -c 'print version' "${tmp_file}")" rm "${tmp_file}" if [[ "${local_version}" == "${remote_version}" ]]; then touch "${local_info_plist}" # Reset timer by touching local file exit 0 fi if [[ "${download_type}" == 'page' ]]; then notification 'Opening download page…' open "${workflow_url}" exit 0 fi readonly download_url="$( if [[ "${download_type}" == 'github_release' ]]; then osascript -l JavaScript -e 'function run(argv) { return JSON.parse(argv[0])["assets"].find(asset => asset["browser_download_url"].endsWith(".alfredworkflow"))["browser_download_url"] }' "$(curl --silent "https://api.github.com/repos/${workflow_url}/releases/latest")" else echo "${workflow_url}" fi )" if url_exists "${download_url}"; then notification 'Downloading and installing…' readonly download_name="$(basename "${download_url}")" curl --silent --location --output "${HOME}/Downloads/${download_name}" "${download_url}" open "${HOME}/Downloads/${download_name}" else abort "'workflow_url' (${download_url}) appears to not be reachable." fi fi scriptargtype 1 scriptfile type 0 type alfred.workflow.action.script uid C4564BA3-C023-400E-AA4E-726CC734C91D version 2 config autopaste clipboardtext {query} ignoredynamicplaceholders transient type alfred.workflow.output.clipboard uid 2A617635-BC53-4025-A598-0A8B1E6C434B version 3 config argumenttype 2 keyword nsn subtext text Open a new Notion page.. withspace type alfred.workflow.input.keyword uid F7D08518-1D55-4B69-AE6C-198FA8628A43 version 1 config browser spaces url https://notion.new utf8 type alfred.workflow.action.openurl uid 0B599F73-39AE-445B-8B09-AA12331F953D version 1 readme Latest updates in 0.6: - Updated cairosvg installation instructions in the readme: run the provided commands in order to get svg icons working on apple silicon. - Type ‘nsn’ for the option to quickly open a new page in Notion. Very handy! (This only works in the web app currently) - https://github.com/wrjlewis/notion-search-alfred-workflow/issues/83 - Fixed a bug that would cause an error and no more results to be displayed when opening pages relating to new Notion projects and icons. ****** PLEASE NOTE ****** Alfred 5 download now available here: https://github.com/wrjlewis/notion-search-alfred5-workflow/ Usual automatic updates will follow once you've updated to the Alfred 5 version of this workflow. If you are on alfred 4, you do not need to do anything and updates will continue as usual. --- notion-search-alfred-workflow An Alfred workflow to search Notion.so with instant results Simply type your keyword into Alfred (default: ns) to see instant search results from Notion that mimic the Quick Find function in the Notion webapp. Selecting a search result takes you to that page in Notion in your default web browser. Documentation, instructions on workflow variables in the readme here: https://github.com/wrjlewis/notion-search-alfred-workflow/ Forum topic: https://www.alfredforum.com/topic/14451-notionso-instant-search-workflow/ Thanks! uidata 0B599F73-39AE-445B-8B09-AA12331F953D xpos 255 ypos 480 2A617635-BC53-4025-A598-0A8B1E6C434B xpos 260 ypos 330 7DD3BDE5-A157-42E5-9376-F681FB50A4EE xpos 50 ypos 50 C4564BA3-C023-400E-AA4E-726CC734C91D colorindex 12 note OneUpdater xpos 255 ypos 175 F7D08518-1D55-4B69-AE6C-198FA8628A43 xpos 65 ypos 480 FCE03E9D-F992-4B21-9A77-E72D5130DF80 xpos 255 ypos 50 variables cookie enableIcons True iconCacheDays 365 isNavigableOnly False notionSpaceId showRecentlyViewedPages True useDesktopClient False variablesdontexport cookie notionSpaceId version 0.6-alfred4 webaddress https://github.com/wrjlewis/notion-search-alfred-workflow/