Skip to content

Instantly share code, notes, and snippets.

@elmimmo
elmimmo / alertIfSpotSeparations.jsx
Created March 5, 2026 15:18
Adobe InDesign startup script that alerts when spot inks are not set to export as process.
//DESCRIPTION:Alert when spot inks are not set to export as process on document open.
// by Jorge Hernández Valiñani (@Estudio Fénix) + Codex (GPT-5)
#target "InDesign"
#targetengine "spotSeparationAlert"
(function () {
var LISTENER_NAME = "spotSeparationAlertListener";
var LABEL_IGNORED_INKS = "spotSeparationAlert.ignoredInks.v1";
@elmimmo
elmimmo / Apply object style to images.jsx
Last active March 5, 2026 15:24
InDesign script to apply an object style to images by the name of their frame.
//DESCRIPTION:Apply an object style to placed images inside frames by the name of their frame.
//by Jorge Hernández Valiñani (@Estudio Fénix) + Codex (GPT-5)
#target indesign
(function() {
var UNDO_LABEL = "Aplicar estilo de objeto a imágenes";
var DIALOG_TITLE = "Aplicar estilo de objeto a contenido";
var ALERT_SELECT_GRAPHIC_FRAME = "Escoge un marco gráfico con una imagen colocada.";
@elmimmo
elmimmo / Place INDD pages into a grid.jsx
Last active March 5, 2026 15:24
InDesign script to place pages from an InDesign document into a grid.
//DESCRIPTION:Place pages from an InDesign document into a grid.
/*
Goal:
- Select one or more source INDD files.
- Calculate and preview a grid on the active page.
- Place source pages at 100% (no rotation), creating destination pages as needed.
- Draw overlay frames on the trim area of each placed page.
Main behavior:
@elmimmo
elmimmo / Batch Export PDF annotations.jsx
Last active March 3, 2026 13:04
InCopy script to export blank PDF with annotations + Acrobat Quick Action JavaScript to import them into PDF exported from InDesign
//DESCRIPTION:Export blank PDF with annotations for later import into PDF exported with InDesign
/*
============================
Export all open documents to PDF
- Hides all layers before export (restores afterwards)
- Enables "Include notes as annotations" (best-effort across versions)
- Exports to the same folder as the document
- Forces file names to end with "_annotations.pdf"
- Shows a summary of failures at the end
@elmimmo
elmimmo / Alert Ungroup.jsx
Last active March 3, 2026 13:01
InDesign startup script that blocks InDesign's native Ungroup command on groups with custom Object Export Options applied and allows to review them before confirming.
//DESCRIPTION:Alerts when ungrouping if there are custom Object Export Options
/*
============================================================================
Blocks InDesign's native Ungroup command whenever the user has selected
one or more groups that have custom Object Export Options applied
(Alt/Actual Text, Decorative flag, or explicit PDF Tag).
The script presents an interactive dialog allowing the user to:
• Review each offending group and its custom export data.
@elmimmo
elmimmo / alertIfAdobeFonts.jsx
Last active March 5, 2026 15:23
Adobe InDesign startup script that alerts if a document uses Adobe Fonts when packaging it.
//DESCRIPTION:Alert when packaging a document if it uses Adobe Fonts.
//by Jorge Hernández Valiñani (@Estudio Fénix) + Gemini
#target "InDesign"
#targetengine "alertIfAdobeFonts"
(function () {
// Configuration: set to false to disable the alert when opening documents
var SHOW_ALERT_ON_OPEN = false;
@elmimmo
elmimmo / get_type_creator.py
Last active March 3, 2026 13:07
Get legacy Mac OS file type and creator codes from files stored on a Synology NAS running DSM
#!/usr/bin/env python3
# by Jorge Hernández Valiñani (@Estudio Fénix) + ChatGPT
import sys, os, struct
def parse_appledouble(ad_path):
"""
Open an AppleDouble file and return (file_type, creator_code).
"""
@elmimmo
elmimmo / command.tool
Last active December 18, 2024 21:40
Run adjacent command-line program from custom directory
#!/usr/bin/env bash
set -e
: ${run_dir:="${HOME}/Library/Application Support/CUSTOM_DIRECTORY"}
# Find absolute path to script
script_path=$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")
if [ -n "$(readlink "$script_path")" ]; then
script_path=$(readlink "$script_path")
@elmimmo
elmimmo / render.zsh
Last active February 8, 2024 18:47
Render multiple Blender documents and their scenes from the command line.
#!/bin/zsh
# Render multiple Blender documents and their scenes from the command line.
# Only scenes named with the suffix "*" will be rendered.
#
# Author: Jorge Hernández Valiñani
# Check dependencies
: "${blender:="/Applications/Blender.app/Contents/MacOS/Blender"}"
@elmimmo
elmimmo / export_snippets.py
Last active February 14, 2025 11:22
Export snippets stored in Dash by kapeli.com to text files
import sqlite3
import os
# Connect to the SQLite database
db_path = "dash snippets.dash" # Path to the SQLite database file
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
# Query to retrieve records from the "snippets" table
cursor.execute("SELECT sid, title, body, syntax FROM snippets")