Activate Normal CreationDate 564694355.70418799 Macros Actions MacroActionType Comment StyledText cnRmZAAAAAADAAAAAgAAAAcAAABU WFQucnRmAQAAAC4kBAAAKwAAAAEA AAAcBAAAe1xydGYxXGFuc2lcYW5z aWNwZzEyNTJcY29jb2FydGYxNjcx XGNvY29hc3VicnRmNjAwCntcZm9u dHRibFxmMFxmbmlsXGZjaGFyc2V0 MCBIZWx2ZXRpY2FOZXVlO30Ke1xj b2xvcnRibDtccmVkMjU1XGdyZWVu MjU1XGJsdWUyNTU7XHJlZDBcZ3Jl ZW4wXGJsdWUwO30Ke1wqXGV4cGFu ZGVkY29sb3J0Ymw7O1xjc3NyZ2Jc YzBcYzBcYzBcY25hbWUgdGV4dENv bG9yO30KXHBhcmRcdHg1NjBcdHgx MTIwXHR4MTY4MFx0eDIyNDBcdHgy ODAwXHR4MzM2MFx0eDM5MjBcdHg0 NDgwXHR4NTA0MFx0eDU2MDBcdHg2 MTYwXHR4NjcyMFxwYXJkaXJuYXR1 cmFsXHBhcnRpZ2h0ZW5mYWN0b3Iw CgpcZjBcZnMyNiBcY2YyIFRoaXMg bWFjcm8gdXNlcyB6a3ZpeiBbMV0g dG8gY3JlYXRlIGEgbmV0d29yayB2 aXN1YWxpemF0aW9uIG9mIHRoZSB0 aGUgbm90ZXMgY3VycmVudGx5IHNl bGVjdGUgaW4gVGhlIEFyY2hpdmUg YXBwIFsyXS5cClwKRm9yIHRoaXMg bWFjcm8gdG8gd29yayBwcm9wZXJs eSwgcGxlYXNlIHNldCB0aGVzZSB2 YXJpYWJsZXM6XApcCi0gWktWSVpf QVJDSElWRV9QQVRIIGlzIHRoZSBw YXRoIHRvIHdoZXJlIHlvdXIgYXJj aGl2ZSBub3RlcyBhcmUgc3RvcmUu IEZvciBleGFtcGxlLCB+L0Ryb3Bi b3gvTm90ZXNcCi0gWktWSVpfUEFU SCBpcyB0aGUgYWJzb2x1dGUgcGF0 aCB0byB0aGUgemt2aXogZXhlY3V0 YWJsZS4gUGxlYXNlIHNlZSBbMV0g Zm9yIGluc3RydWN0aW9ucyBvZiBo b3cgdG8gaW5zdGFsbCBpdC4gVGhl IHBhdGggYmVsb3cgdXNlcyB0aGUg b25lIHlvdSdkIGhhdmUgaWYgeW91 IGZvbGxvd2VkIHRoZSBpbnN0cnVj dGlvbnMgZGlyZWN0bHkuXAotIFpL VklaX1VTRV9HUkFQSFZJWiBzZXQg dG8gMSBpZiB5b3Ugd2FudCB0byB1 c2UgR3JhcGh2aXogdG8gZ2VuZXJh dGUgdGhlIHZpc3VhbGl6YXRpb24u IE9yIHVzZSAwIGlmIHlvdSB3YW50 IHRvIHVzZSBQbG90bHlcClwKXApb MV06IGh0dHBzOi8vZ2l0aHViLmNv bS9aZXR0ZWxrYXN0ZW4tTWV0aG9k L3prdml6XApbMl06IGh0dHBzOi8v emV0dGVsa2FzdGVuLmRlL3RoZS1h cmNoaXZlL30BAAAAIwAAAAEAAAAH AAAAVFhULnJ0ZhAAAAA/NkpdtgEA AAAAAAAAAAAA Title README ActionName Set ARCHIVE_PATH to the folder containing your archive MacroActionType SetVariableToText Text ~/projects/zkviz/data/notes Variable ZKVIZ_ARCHIVE_PATH ActionName Set path to the zkviz executable MacroActionType SetVariableToText Text ~/envs/zkviz/bin/zkviz Variable ZKVIZ_PATH ActionName Choose whether to use Graphviz or not to render the visualization [0 or 1] MacroActionType SetVariableToText Text 0 Variable ZKVIZ_USE_GRAPHVIZ ActionName Notify that listing all notes might take a little while IsDisclosed MacroActionType Notification SoundName Subtitle Listing notes selected in The Archive. Text This might take a few seconds. Title zkviz ActionName Get the name of all the files selected in The Archive DisplayKind Variable IncludeStdErr IsDisclosed MacroActionType ExecuteAppleScript NotifyOnFailure Path StopOnFailure Text use AppleScript version "2.4" -- Yosemite (10.10) or later use scripting additions tell application "System Events" tell its application process "The Archive" tell its window "The Archive" tell its splitter group 1 tell its splitter group 1 tell its scroll area 2 tell its table 1 set theRows to rows set theNames to {} repeat with theRow in theRows set theName to the name of item 1 of UI element of theRow set theName to theName & ".md" copy theName to the end of theNames end repeat set AppleScript's text item delimiters to linefeed set theFileNames to theNames as string set AppleScript's text item delimiters to "" return theFileNames end tell end tell end tell end tell end tell end tell end tell TimeOutAbortsMacro TrimResults TrimResultsNew UseText Variable ZKVIZ_ZETTEL_FILENAMES Action ExpandTildeInPath ActionName Expand Tilde in ZKVIZ_ARCHIVE_PATH IsDisclosed MacroActionType Filter Source Variable Variable ZKVIZ_ARCHIVE_PATH Action ExpandTildeInPath ActionName Expand Tilde in ZKVIZ_ARCHIVE_PATH IsDisclosed MacroActionType Filter Source Variable Variable ZKVIZ_PATH Action IgnoreCaseRegEx ActionName Prepend the path to the archive to each filename IsDisclosed MacroActionType SearchReplace Replace %Variable%ZKVIZ_ARCHIVE_PATH%/ Search (?m)^ Source Variable Variable ZKVIZ_ZETTEL_FILENAMES ActionName Execute zkviz with the files selected. DisplayKind Window IncludeStdErr MacroActionType ExecuteShellScript Path /Users/chabot/projects/zkviz/env/bin/zkviz Source Nothing StopOnFailure Text #!/usr/bin/env python import os import subprocess # Get path to the zkviz executable zkviz = os.environ['KMVAR_ZKVIZ_PATH'] # Check if `/usr/local/bin` is in the PATH, which is needed for Graphviz. # If not, append it. if '/usr/loca/bin/' not in os.environ['PATH']: os.environ['PATH'] += ':/usr/local/bin' # Use graphviz or not use_graphviz = int(os.environ['KMVAR_ZKVIZ_USE_GRAPHVIZ']) # Get the list of paths using environment variables. filenames = os.environ['KMVAR_ZKVIZ_ZETTEL_FILENAMES'].strip().splitlines() # Create the output file next to your zettels. Otherwise, we run into a permission issue. archive_path = os.path.expanduser(os.environ['KMVAR_ZKVIZ_ARCHIVE_PATH']) output_filename = os.path.join(archive_path, 'zettel-network.html') # Build the arguments to execute args = [zkviz, '--output', output_filename] + filenames if use_graphviz: args.insert(1, '--use-graphviz') # Capture error messages and display them if something happens. Otherwise, # this should print any output. try: output = subprocess.check_output(args, stderr=subprocess.STDOUT) except subprocess.CalledProcessError as exc: print("Status : FAIL", exc.returncode, exc.output) TimeOutAbortsMacro TrimResults TrimResultsNew UseText CreationDate 582430104.35251606 ModificationDate 586837783.08286202 Name Generate network visualization of notes selected in The Archive using zkviz Triggers FireType Pressed KeyCode 45 MacroTriggerType HotKey Modifiers 4352 UID 4C49BA73-EEC5-4AE2-A29B-178F17D9C3B4 Name App - The Archive Targeting Targeting Included TargetingApps BundleIdentifier de.zettelkasten.TheArchive Name The Archive NewFile /Applications/The Archive.app ToggleMacroUID CDBB7F8C-8114-42A6-B9EE-4B5A8169A575 UID 048F20DA-8E8A-4EDF-94E7-2F34B783DD5B