LoginSignup
3
4

More than 5 years have passed since last update.

InDesignのJavaScriptでaddEventListener()

Posted at

InDesignでのaddEventListener()の使い方

スクリプト冒頭で#targetengine "seccion"の指定が必須。

AFTER_SAVE.js
#targetengine "session"

var main = (function() {

  // 現在アクティブな書類
  var doc = app.activeDocument;

  // ドキュメントの保存後にコールバックを実行
  doc.addEventListener(Document.AFTER_SAVE, function(){
    alert('test');

    // すべてのイベントリスナーを削除
    doc.eventListeners.everyItem().remove();
  });

})();

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4