Last active
March 28, 2016 00:33
-
-
Save milligramme/416d6cb51a8cb555052b to your computer and use it in GitHub Desktop.
bug in InDesign XXXStyle.previewColor
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
var UIC = [ | |
"BLACK", | |
"BLUE", | |
"BRICK_RED", | |
"BROWN", | |
"BURGUNDY", | |
"CHARCOAL", | |
"CUTE_TEAL", | |
"CYAN", | |
"DARK_BLUE", | |
"DARK_GREEN", | |
"FIESTA", | |
"GOLD", | |
"GRASS_GREEN", | |
"GRAY", | |
"GREEN", | |
"GRID_BLUE", | |
"GRID_GREEN", | |
"GRID_ORANGE", | |
"LAVENDER", | |
"LIGHT_BLUE", | |
"LIGHT_GRAY", | |
"LIGHT_OLIVE", | |
"LIPSTICK", | |
"MAGENTA", | |
"OCHRE", | |
"OLIVE_GREEN", | |
"ORANGE", | |
"PEACH", | |
"PINK", | |
"PURPLE", | |
"RED", | |
"SULPHUR", | |
"TAN", | |
"TEAL", | |
"VIOLET", | |
"WHITE", | |
"YELLOW" | |
]; | |
var create_guide_with_uicolor_and_style_preview_color = function (doc, list) { | |
doc.layers[0].layerColor = [255,255,255]; | |
for (var i=0, len=list.length; i < len ; i++) { | |
var tf = doc.pages[0].textFrames.add({geometricBounds: [(20 + i*5)+'mm', '20mm', (24 + i*5)+'mm', '60mm'], contents: "UIColors."+list[i]}) | |
var pstyle = doc.paragraphStyles.add({name: list[i]}); | |
tf.parentStory.appliedParagraphStyle = pstyle; | |
pstyle.previewColor = UIColors[list[i]]; | |
var guide = doc.guides.add({orientation: HorizontalOrVertical.HORIZONTAL, location:(24 + i*5)+'mm'}); | |
guide.guideColor = UIColors[list[i]]; | |
}; | |
app.activeWindow.overprintPreview = false; | |
app.activeWindow.screenMode = ScreenModeOptions.PREVIEW_OFF; | |
doc.textPreferences.enableStylePreviewMode = true; | |
} | |
create_guide_with_uicolor_and_style_preview_color(app.documents.add(), UIC); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jsxの実行結果のinddのずれをIDMLにして、IDML→inddするとまた色がずれる T_T