Created
February 20, 2015 00:52
-
-
Save milligramme/5521c90fd055a97e2470 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#target "indesign" | |
#include "underscore.js" | |
var find_this_link = function (FILENAME) { | |
var doc = app.documents[0]; | |
_.each(doc.links, function (x) { | |
if(x.name == FILENAME) { | |
try { | |
x.parent.select(SelectionOptions.ADD_TO); | |
} | |
catch(x_x){ | |
// ex 異なるスプレッド上の 2 つのオブジェクトを選択することはできません。 | |
$.writeln([ | |
x_x.message, | |
x_x.line, | |
x_x.stack, | |
].join("\n")); | |
} | |
} | |
}) | |
} | |
if (new File($.fileName).name==$.stack.replace(/[\[\]\n]/g,"")) { | |
find_this_link('anything.ai'); | |
app.activeWindow.zoom(ZoomOptions.FIT_PAGE); | |
// app.activeWindow.zoomPercentage = 200; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment