Skip to content

Osva1d/applescript-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppleScript Automation for Print Production

License Platform

Language: English · Čeština

Workflow automation for a print studio — creating project folders, generating Adobe Bridge headers, and configuring Finder automatically at login.

Note: The scripts ship with placeholder values for paths and server names. Before first use, edit the property constants at the top of each script to match your environment (see the Configuration section).


Table of contents


Scripts

1. create-project-folders.applescript (v1.3.0)

  • Extracts data from a Safari order sheet
  • Creates a structured project folder hierarchy
  • Auto-names by the pattern: number - client - project
  • Creates subfolders: pracovni, zdroje, and a final folder XX_number (XX = last two digits of the current year)
  • Shortcuts.app compatible

2. generate-bridge-header.applescript (v2.3.0)

  • Generates a centred header for Adobe Bridge (85 characters, Menlo font)
  • Smart client-name shortening (strips legal-form suffixes)
  • Auto-copies the header to the clipboard
  • Locates the production folder and opens it in Bridge
  • Dynamically detects the installed Adobe Bridge version
  • Shortcuts.app compatible

3. start-finder.applescript (v14.4.1)

  • Auto-mounts network volumes at login (AFP/SMB)
  • Checks network availability before mounting, with a configurable timeout
  • Creates a Finder window with tabs for production folders
  • Status notification — success or list of unmounted volumes

Requirements

  • macOS 13+ (Ventura or newer)
  • Safari — for reading order sheets (create-project-folders, generate-bridge-header)
    • "Allow JavaScript from Apple Events" must be enabled (Safari → Develop → Allow JavaScript from Apple Events)
  • Shortcuts.app — for running the scripts
  • Adobe Bridge (optional) — for using the headers (generate-bridge-header)
  • Accessibility permission — required for start-finder (System Settings → Privacy & Security → Accessibility)

Installation

All three scripts run via Shortcuts.app:

  1. Open Shortcuts.app.
  2. Create a new shortcut.
  3. Add the "Run AppleScript" action.
  4. Paste the contents of the relevant .applescript file.
  5. Name the shortcut (e.g. "Create Folders", "Bridge Header", "Start Finder").
  6. Optional: bind a keyboard shortcut or add it to the menu bar.

start-finder — run automatically at login

  1. System Settings → General → Login Items.
  2. Add the "Start Finder" shortcut.
  3. The script will run automatically after each login.

Configuration

Each script has property constants at the top of the file that must be customised for your environment.

create-project-folders.applescript

Property Purpose Default (placeholder)
PROJECT_BASE_PATH Root path where folders are created "/Volumes/PrintServer/Projects/Print Production"
SUBFOLDER_NAMES Subfolder names {"pracovni", "zdroje"}
DANGEROUS_CHARS Characters replaced with underscore {"/", "\\", ":", "*", "?", "<", ">", "|"}

generate-bridge-header.applescript

Property Purpose Default (placeholder)
PROJECT_BASE_PATH Path searched for the production folder "/Volumes/PrintServer/Projects/Print Production"
TOTAL_HEADER_WIDTH Header width in characters (Menlo font) 85
MAX_CLIENT_LENGTH Maximum client-name length 25
MIN_SPACING Minimum spacing between header elements 2

start-finder.applescript

Property Purpose Default (placeholder)
CHECK_SERVER Server used to test network reachability "fileserver.local"
SERVER_LIST Network volumes to mount {dName, dAddr} see script
PANEL_PATHS POSIX paths for Finder tabs (first = main window) see script
NETWORK_TIMEOUT Max seconds to wait for the network 60
TAB_DELAY Delay between tab creations (raise on slower machines) 0.6
WINDOW_BOUNDS Finder-window position and size {left, top, right, bottom} {50, 50, 1600, 1000}

Usage

Creating project folders

  1. Open the order sheet in Safari.
  2. Run the "Create Folders" shortcut.
  3. Review the extracted data and confirm creation.
  4. The folder is created and revealed in Finder.

Generating a Bridge header

  1. Open the order sheet in Safari.
  2. Run the "Bridge Header" shortcut.
  3. The header is copied to the clipboard.
  4. The script locates the production folder and offers to open it in Bridge.
  5. Paste into Adobe Bridge (Cmd+V).

Finder setup (start-finder)

  1. Runs automatically at login (or run it manually).
  2. Waits for the network server to become reachable (max 60 s).
  3. If waiting exceeds 5 s, a "Waiting for network…" notification is shown.
  4. Mounts every network volume that is not yet mounted.
  5. Opens Finder with one window and a tab for each configured path.
  6. Shows a summary notification.

Shared code

create-project-folders and generate-bridge-header share helper functions:

  • getCurrentYearSuffix() — last two digits of the current year
  • extractJSONValue() — extracts values from a JSON string

Changes to these helpers must be propagated to both scripts manually.


Troubleshooting

Safari returns an error when reading data

Symptom: Dialog "Error reading data from Safari"

Resolution:

  1. Check that you are on the correct order-sheet page.
  2. Try reloading the page (Cmd+R).
  3. Use manual entry in the format: number - client - project
    • Example: 12345 - ACME Corp - Logo Redesign

Expected Safari DOM structure: the script reads HTML elements:

  • <span class="Header1"> containing "Zakazka cislo: X.Y"
  • <td class="TabColHead"> with texts "Projekt:" and "Klient:"
  • <td class="TabValue"> with the values next to them

If the order-sheet structure changes, use manual entry.

Folder already exists

Symptom: Alert "Folder already exists"

Resolution:

  • Click "Open Folder" to reveal the existing structure.
  • To create a new one, change the order number or project name.

Volume not mounted

Symptom: Notification "Network volume is not mounted"

Resolution:

  1. Mount the network volume manually in Finder.
  2. Verify the path inside the script:
    • Open the script in Script Editor.
    • Find the line: property PROJECT_BASE_PATH : "..."
    • Edit the path to match your environment.
    • Save (Cmd+S).
  3. Re-run the script.

Safari is not running

Symptom: Alert "Safari is not running"

Resolution:

  • Launch Safari before running the script.
  • Open the order sheet.
  • Try again.

Folder name is too long

Symptom: Alert "Folder name is too long"

Resolution:

  • macOS folder-name limit is 255 characters (the script enforces 240).
  • Shorten the client or project name in the order sheet.
  • Or use manual entry with shorter names.

start-finder: "Not allowed assistive access"

Symptom: System dialog about missing Accessibility permission

Resolution:

  • System Settings → Privacy & Security → Accessibility.
  • Allow Shortcuts.app (or the terminal you launched the script from).

start-finder: Network unreachable

Symptom: Dialog "Network unreachable" after the timeout expires

Resolution:

  • Check your network connection.
  • Verify that CHECK_SERVER points to the correct host.
  • Increase NETWORK_TIMEOUT for slow networks.

start-finder: WINDOW_BOUNDS does not match the display

Resolution:

  • Read your display dimensions from Script Editor: tell application "Finder" to get bounds of window of desktop
  • Use the result as the WINDOW_BOUNDS value.

Known limitations

  • Safari-dependent: create-project-folders and generate-bridge-header expect a specific HTML structure of the order sheet.
  • Finder tabs: start-finder creates tabs via keystroke "t" using command down (System Events) — Finder has no native AppleScript command for creating tabs.
  • Accessibility: start-finder requires the Accessibility permission to send keystrokes.
  • WINDOW_BOUNDS: hardcoded for a specific monitor resolution — must be adjusted when the display changes.
  • TAB_DELAY: may need to be increased on slower machines.
  • No batch mode: one project / one header at a time.
  • No undo: created folders must be removed manually.
  • close every window: start-finder closes every open Finder window on launch — intentional for a clean state at login, but destructive when run manually.

Changelog

All changes are documented in CHANGELOG.md.


Licence

This project is licensed under the MIT Licence — see LICENSE.

Free for personal and commercial use, including modification and redistribution. The only requirement is that the copyright notice is preserved. No warranty.


Author

  • Concept and testing: Ladislav Osvald
  • Implementation: Claude (Anthropic AI)
  • Year: 2025–2026

About

AppleScript tools for print production workflow automation

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors