Zettelkasten Forum


Selecting the archive directory on startup?

Is there a way to specify the archive directory on startup?

The reason being that I want to set up a second directory for a work project that I will eventually pass off to someone else so I need to keep it separate from my personal stuff.

I did a quick scan through the forum and couldn't see an answer. Thanks.

Comments

  • @Brad_T said:
    Is there a way to specify the archive directory on startup?

    The reason being that I want to set up a second directory for a work project that I will eventually pass off to someone else so I need to keep it separate from my personal stuff.

    I did a quick scan through the forum and couldn't see an answer. Thanks.

    There is an option, using the dropdown menu under "The Archive", to "Switch Archives...". Pretty ease to do.

  • Thanks for the answer.

    What I had hoped to find out was, if there was a way to use some command line magic, or add a second icon on my desktop to open up the different directory (instead using the dropdown menu to switch).

  • edited August 2023

    I do have a secret debug switch for this for testing as a launch argument.

    You can pass the archiveURL on the command line like so:

    $ /Applications/The\ Archive.app/Contents/MacOS/The\ Archive -archiveURL "file:///Users/YOURUSER/path/to/notes/"
    
    1. The path must end with a /
    2. The URL must be a file:// URL
    3. You must open the /Contents/MacOS/The\ Archive binary inside the .app bundle -- you can't just open The\ Archive.app and pass this

    Edit: I must've slept on this change, but I just discovered that you can also use this to pass another directory:

    $ open -n /Applications/The\ Archive.app --args -archiveURL "file:///Users/YOURUSER/path/to/notes/"
    

    Author at Zettelkasten.de • https://christiantietze.de/

  • Perfect. Exactly what I was after. Thank you.

  • edited May 3

    I did a first pass at using Automator to run AppleScript to launch with specific directories.

    Code is attached for reference if anyone needs a script in the future.

    on run {input, parameters}
    
        set Ze to "\"/Applications/The Archive.app\""
    
        set DB to "\"file:///Users/YOURUSER/Documents/Zettelkasten/MYNOTES1/\""
    
        set myC to "open -n " & Ze & " --args -archiveURL " & DB
    
        tell application "Terminal"
            activate
            do script myC
        end tell
    
        return input
    
    end run
    

    Then you can copy the script icon to the desktop to have quick access.

    Brad

    Post edited by ctietze on
  • @Brad_T if you use a Shell Script task in Automator, it might be even quicker (I never know if loading the AppleScript environment takes long, or if it's the Automator action itself)

    Author at Zettelkasten.de • https://christiantietze.de/

  • It would be nice to have an option in TAAP (The Archive) itself to swich to former folder, so you could quickly switch. Even better: multi folder support with 2 folders open at the same time.

Sign In or Register to comment.