Skip to content

Instantly share code, notes, and snippets.

@alastori
alastori / org-obsidian-screenshots.py
Created July 30, 2024 18:54
This Python script processes referenced screenshots in Obsidian Markdown files, renaming them to include the Markdown file's name and a unique timestamp. It updates the Markdown files with the new filenames and generates a processing report. Create a config.ini file with your notes directory and maximum filename length, then run the script.
# org-obsidian-screenshots.py
"""
Script to Organize and Rename Screenshot Files in Obsidian Markdown Notes
Purpose:
This script processes referenced screenshots in Obsidian Markdown (`.md`) files. It renames the screenshot files to include the name of the Markdown file and a unique timestamp. Additionally, it updates the Markdown files to reference the new screenshot filenames and generates a processing report.
Usage:
1. Create a `config.ini` file in the same directory as the script with the following content:
@vitaLee
vitaLee / snap_lines_to_indent_level_command.py
Created June 5, 2012 17:02
SublimeText command for snapping displaced text to indentation
# sample shortcuts
{ "keys": ["ctrl+super+]"], "command": "snap_lines_to_indent_level", "args": { "snap_direction": 1 } },
{ "keys": ["ctrl+super+["], "command": "snap_lines_to_indent_level", "args": { "snap_direction": -1 } }