Automatische Schriften-Aktivierung ist eigentlich verpönt, manchmal trotzdem recht praktisch. Bei meinem aktuellen Setting InDesign CS5.5 und InDesign CS6 in Kombination mit Suitcase Fusion 1 (ja, alle drei laufen problemlos unter MacOS X 10.13!) funktioniert das mit Suitcase Fusion ausgelieferte Auto-Aktivieren-Plugin leider nicht mehr. Jenes geht nur bis zur CS3.

Wieso mein Arbeitgeber 120$ für die neuste Suitcase-Version ausgeben soll, wenn das Programm an sich funktioniert, kann ich ihm leider nicht verklickern.

Und so klicke ich krame ich immer wieder durch die Suitcase-Schriftensammlung und aktiviere die fehlenden Schriften von Hand.

"Kann man sich da nicht ein Skript zusammenbasteln...?" dachte ich mir heute.

Eigentlich: Kann man (mit AppleScript)!
Aber...

Leider funktioniert es in meinem Fall nicht wirklich

Es ist seltsam...solche Sachen funktionieren an sich immer prima, aber letztendlich dann – wieso auch immer – scheitern sie beim allerletzten Punkt aus unerfindlichen Gründen.

Problem: Skript erfasst alle fehlenden Schriften und aktiviert jene (falls dort gefunden) in Suitcase.
Die Schriften sind in Suitcase tatsächlich aktiviert. Allerdings scheint InDesign das nicht zu checken. Für InDesign fehlt die Schrift weiterhin. Erst wenn man InDesign beendet und neu öffnet, sind die Schriften dann aktiv. Nicht gerade sehr praktikabel.

Ich bin nur nicht so ganz dahinter gekommen, was für InDesign der Unterschied ist, ob ich die Schriften in Suitcase per Script (funktioniert letztendlich nicht) oder per Klick (funktioniert letztendlich) aktiviere.
Es gibt zwar eine Methode update fonts, die laut Dokumentation dazu führen sollte, dass InDesign die eben aktivierten Schriften erkennen sollte.
Funktioniert aber nicht.
Ärgerlich.

Trotzdem: Im Folgenden meine gesammelte Erkenntnisse.

Einfaches Skript

tell application "Adobe InDesign CS6"
  set myDoc to front document
  tell myDoc
    set theFonts to properties of every font
    repeat with theFont in theFonts
      --display dialog (full name native of theFont) & " " & (status of theFont)
      if status of theFont is substituted then
        set fontName to (full name native of theFont)
        tell application "Suitcase Fusion"
          -- Achtung: Hier bekomme ich entweder einen Font oder eine Liste von Fonts!
          set theSuitcaseFonts to Font fontName
          if class of theSuitcaseFonts is Font then
            set activation status of theSuitcaseFonts to activated
          else if class of theSuitcaseFonts is list then
            repeat with theSuitcaseFont in theSuitcaseFonts
              set activation status of theSuitcaseFont to activated
            end repeat
          end if
        end tell
        --display dialog "Aktiviere " & fontName
      end if
    end repeat
  end tell
  update fonts
end tell

Das Skript frägt zuerst alle Schriften des aktiven InDesign-Dokuments ab und prüft für jede Schrift, ob sie den Status substituted (=> fehlend) hat.
Falls sie fehlt, schauen wir, ob es in Suitcase eine Schrift dieses Namens gibt. Ich musste feststellen, dass ich öfters mehrere Schriften dieses Namens habe und die erste nicht unbedingt die richtige ist. Deshalb gehe ich hier alle durch und aktiviere sie.

Sicher nicht die beste Lösung, wenn man ein InDesign-Dokument von jemand anderem bekommt und ein Druck-PDF draus schreiben will; hilft mir selbst aber enorm.

Das Skript kann man in der InDesign-Skriptpalette ablegen und dort per Doppelklick starten oder mit einem Hotkey belegen.

Folgende Version ist etwas gesprächiger

Version 1.1
tell application "Adobe InDesign CS6"
  set myDoc to front document
  tell myDoc
    set theFonts to properties of every font
    set startMissingCount to 0
    repeat with theFont in theFonts
      if status of theFont is substituted then
        set startMissingCount to startMissingCount + 1
        set fontName to (full name native of theFont)
        tell application "Suitcase Fusion"
          -- Achtung: Hier bekomme ich entweder einen Font oder eine Liste von Fonts!
          set theSuitcaseFonts to Font fontName
          if class of theSuitcaseFonts is Font then
            set activation status of theSuitcaseFonts to activated
          else if class of theSuitcaseFonts is list then
            repeat with theSuitcaseFont in theSuitcaseFonts
              set activation status of theSuitcaseFont to activated
            end repeat
          end if
        end tell
      end if
    end repeat
    -- Alle weiterhin fehlenden Schriften auflisten
    set endMissingCount to 0
    set theFonts to properties of every font
    repeat with theFont in theFonts
      if status of theFont is substituted then
        set endMissingCount to endMissingCount + 1
      end if
    end repeat
    if endMissingCount < startMissingCount then
      display dialog "Es wurden " & (startMissingCount - endMissingCount) & " Schriften ersetzt. Weiterhin fehlend: " & endMissingCount & " Schriften" buttons {"OK"} default button 1
    else if endMissingCount > 0 then
      display dialog "Es fehlen weiterhin " & endMissingCount & " Schriften." buttons {"OK"} default button 1
    end if
  end tell
  update fonts
end tell

Vollautomatik

An sich handelt es sich hier noch nicht um eine auto-Aktivierung. Mehr um eine Halb-Automatik.
Um die Schriften automatisch beim Öffnen eines Dokumentes zu aktivieren, müsste man das Skript etwas umschreiben und in den Ordner Scripts > startup scripts (statt scripts > Scripts Panel) legen.
Leider löst das Skript trotz des Events afterOpen zu früh aus und ich bekomme Fehlermeldungen.

Vollautomatik
tell application "Adobe InDesign CS6"
  make event listener with properties {event type:"afterOpen", handler:my autoactivate}
end tell

on autoactivate()
  delay 5
  tell application "Adobe InDesign CS6"
    set myDoc to front document
    tell myDoc
      set theFonts to properties of every font
      set startMissingCount to 0
      repeat with theFont in theFonts
        if status of theFont is substituted then
          set startMissingCount to startMissingCount + 1
          set fontName to (full name native of theFont)
          tell application "Suitcase Fusion"
            -- Achtung: Hier bekomme ich entweder einen Font oder eine Liste von Fonts!
            set theSuitcaseFonts to Font fontName
            if class of theSuitcaseFonts is Font then
              set activation status of theSuitcaseFonts to activated
            else if class of theSuitcaseFonts is list then
              repeat with theSuitcaseFont in theSuitcaseFonts
                set activation status of theSuitcaseFont to activated
              end repeat
            end if
          end tell
        end if
      end repeat
      -- Alle weiterhin fehlenden Schriften auflisten
      set endMissingCount to 0
      set theFonts to properties of every font
      repeat with theFont in theFonts
        if status of theFont is substituted then
          set endMissingCount to endMissingCount + 1
        end if
      end repeat
      if endMissingCount < startMissingCount then
        display dialog "Es wurden " & (startMissingCount - endMissingCount) & " Schriften ersetzt. Weiterhin fehlend: " & endMissingCount & " Schriften" buttons {"OK"} default button 1
      else if endMissingCount > 0 then
        display dialog "Es fehlen weiterhin " & endMissingCount & " Schriften." buttons {"OK"} default button 1
      end if
    end tell
  update fonts
  end tell
end autoactivate

Nur Schriften in bestimmter Gruppe

Möchte man nur Schriften aus einer bestimmten Gruppe/Set innerhalb von Suitcase aktivieren... (hier im Beispiel "Meine Schriften-Gruppe")

tell application "Adobe InDesign CS6"
  tell application "Suitcase Fusion" to activate
  set myDoc to front document
  tell myDoc
    set theFonts to properties of every font
    set startMissingCount to 0
    repeat with theFont in theFonts
      if status of theFont is substituted then
        set startMissingCount to startMissingCount + 1
        set fontName to (full name native of theFont)
        tell application "Suitcase Fusion"
          set theSuitcaseFonts to Font fontName of Font Set "Meine Schriften-Gruppe"
          -- Achtung: Hier bekomme ich entweder einen Font oder eine Liste von Fonts!
          if class of theSuitcaseFonts is Font then
            set activation status of theSuitcaseFonts to activated temporarily
          else if class of theSuitcaseFonts is list then
            repeat with theSuitcaseFont in theSuitcaseFonts
              set activation status of theSuitcaseFont to activated temporarily
            end repeat
          end if
        end tell
      end if
    end repeat
  end tell
  update fonts
end tell

Fazit

Könnte alles so einfach und schön sein...aber wenn's aus undefinierbaren Gründen letztendlich scheitert...schade!