Helper script to open Observable Notebook 2.0 files in Observable Desktop until the HQ team adds that into the app. ```bash #!/usr/bin/env bash # Script to open Observable Desktop and navigate to a specified file # This script automates the File -> Open…. menu navigation # Usage: ./open_observable.sh [file_path] # If no file path is provided, defaults to histheat index.html if [ $# -eq 0 ]; then FILE_PATH="/Users/hrbrmstr/observable/histheat/docs/index.html" echo "No file path provided. Using default: $FILE_PATH" else # Convert relative path to absolute path if needed if [[ "$1" = /* ]]; then FILE_PATH="$1" else FILE_PATH="$(pwd)/$1" fi echo "Opening file: $FILE_PATH" fi if [ ! -f "$FILE_PATH" ]; then echo "Error: File does not exist: $FILE_PATH" echo "Usage: $0 [file_path]" echo " file_path can be absolute or relative to current directory" echo " If no file_path provided, uses default histheat index.html" exit 1 fi echo "Opening Observable Desktop and navigating to file..." echo "Note: Make sure Observable Desktop has accessibility permissions if prompted" osascript -e 'tell application "Observable Desktop" to activate' sleep 1 osascript -e ' tell application "System Events" tell process "Observable Desktop" -- Click on File menu click menu bar item "File" of menu bar 1 delay 0.5 -- Click on Open... menu item click menu item "Open…" of menu "File" of menu bar item "File" of menu bar 1 delay 2 end tell end tell' sleep 1 osascript -e ' tell application "System Events" -- Use Cmd+Shift+G to open "Go to folder" dialog keystroke "g" using {command down, shift down} delay 1 -- Type the full path to the file keystroke "'"$FILE_PATH"'" delay 0.5 -- Press Enter to navigate to the file keystroke return delay 1 -- Press Enter again to open the file keystroke return end tell' echo "Done! The Observable file should now be open." ```