Ultimate Automation with QuickAdd - a final look at the Clothesline method
Based on Zsolt's Visual Personal Knowledge Management's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
QuickAdd macros can run scripts only when the XColorDraw view is active, enabling context-aware automation for canvas cards.
Briefing
QuickAdd automation can turn Obsidian’s “clothesline” drawing workflow into a two-track process: each time a user adds a card in the XColorDraw canvas, a script immediately prompts for the card title, creates/updates a matching “card details” markdown file, and then inserts a new card on the canvas with the title and a clickable link back to that details file. The key advantage over templating is that QuickAdd can run scripts specifically when the XColorDraw view is active, letting the macro react to the drawing context instead of relying on a static template.
The setup starts by creating a QuickAdd macro named “clothesline add card.” The macro runs two prepared scripts in sequence. Step one handles the user interaction and file naming: it shows an input prompt asking for the card title, stores that title in a variable, then derives a “card details” file path from the active drawing’s file path. The script takes the drawing’s path, strips the extension, and appends “card details” so the details file shares the drawing’s base name. Step one also prepares the capture target by writing a header line (a markdown “#” title) into that details file.
Step two focuses on the canvas update. It initializes the XColorDraw automation component using the currently active view (a change from earlier approaches that couldn’t target the XColorDraw view directly). It then creates a new card in the drawing. If another element is selected, the script positions the new card relative to that selection so cards “hang” beneath one another. The card gets a colorful header area: a random color is chosen from the available palette, and the card title is placed centered on the card. Finally, the card includes a link in the bottom-right corner that points to the card details file. That link text is generated via Obsidian’s metadata cache, respecting whether the user prefers full or relative links.
Once the macro is configured, the user assigns it to the command palette and binds it to a hotkey (Control 1). In practice, pressing the hotkey while the drawing is open triggers the title prompt; after entering a title, the macro creates the card details file and inserts a new card into the canvas. Repeating the hotkey adds additional cards, stacking them under the previously selected card.
Two refinements improve the editing experience in the details file. First, the capture operation is adjusted to insert an empty line after each header so the markdown stays readable. Second, the capture is set to write to the bottom of the file, ensuring new headings appear in reverse order of creation (newest at the bottom) rather than being inserted near the top. After these tweaks, subsequent card additions keep the details file neatly structured, and the links from the canvas continue to resolve to the correct details pages.
The workflow ends with a promise of another macro-focused video for a more complex “crazy type” presentation, along with links to the scripts and an “empty template” file for recreating the setup.
Cornell Notes
QuickAdd can automate XColorDraw “clothesline” cards by running scripts only when the XColorDraw view is active. A single macro (“clothesline add card”) runs two scripts: Step one prompts for a card title, derives a card-details markdown file path from the active drawing, and captures a markdown header into that file. Step two creates the visual card in XColorDraw, positions it relative to any selected element, assigns a random header color, places the title on the card, and adds a clickable link to the card-details file. Hotkey-driven use lets brainstorming happen on the canvas while the corresponding details files are built in the background.
How does the macro decide where the card-details markdown file should live and what it should be called?
What does Step one capture into the details file, and how is the card title reused later?
How does Step two place new cards in the XColorDraw canvas relative to existing cards?
Where does the clickable link on the card come from?
What two changes were made to improve the formatting of the details file as more cards are added?
Review Questions
- If the active view is not an XColorDraw raw view, what failure mode does the script risk, and why?
- Describe how the macro ensures the card title entered by the user ends up both on the canvas card and in the corresponding markdown details file.
- Why does changing the capture setting to “write to bottom of the file” affect the order of headings as new cards are created?
Key Points
- 1
QuickAdd macros can run scripts only when the XColorDraw view is active, enabling context-aware automation for canvas cards.
- 2
A two-step macro workflow prompts for a card title, then uses that title to both update a markdown details file and render a new card on the canvas.
- 3
Card-details file paths are derived from the active drawing’s file path by stripping the extension and appending “card details.”
- 4
New cards can be positioned beneath a selected element, letting users stack “clothesline” cards during brainstorming.
- 5
The card includes a clickable link generated via Obsidian’s metadata cache, honoring full vs relative link preferences.
- 6
Formatting improvements—adding an empty line after each capture and writing to the bottom—keep the details file clean and ordered as cards accumulate.