Using the method, you can create a macro called "Nav Link" that prompts you: "What path?" You reply: "Slash products slash new dash item dot php" and Dragon inserts the entire HTML anchor tag. 3. Managing JSON Configurations Config files are filled with file links. Example:
# dragon_file_link_bridge.py import os import subprocess import json This script fetches the current open file's directory and builds a relative link def create_relative_link(target_file, current_file): current_dir = os.path.dirname(current_file) rel_path = os.path.relpath(target_file, current_dir) # Copy to clipboard import pyperclip pyperclip.copy(rel_path) # Simulate Ctrl+V paste subprocess.run(["powershell", "-Command", "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SendKeys]::SendWait('^v')"]) dragon coding file link
With a macro, you can navigate between key-value pairs, say "Set output directory to dot slash dist" , and the macro intelligently handles the quotes and slashes. Troubleshooting Common Dragon Coding File Link Issues Problem: Dragon types double slashes (e.g., C:\\Users ). Solution: You have "Dictation Mode" on. Switch to "Spell Mode" or create a custom command that uses SendKeys with raw strings. Using the method, you can create a macro
By: TechEdge Staff
if == " main ": # Example usage: python script.py "target.json" "C:\current\file.js" create_relative_link(sys.argv[1], sys.argv[2]) Example: # dragon_file_link_bridge
Have you built a custom Dragon macro for file linking? Share your script in the comments below. For more articles on assistive technology for developers, subscribe to our newsletter.