-
Notifications
You must be signed in to change notification settings - Fork 30
Effects
fabiantheblind edited this page May 4, 2016
·
3 revisions
This script is a mixture of basil.js and raw indesign API calls. We apply all the effects that are possible to some ellipses.
#includepath "~/Documents/;%USERPROFILE%Documents";
#include "basiljs/bundle/basil.js";
function draw() {
// code goes here -----------
var doc = b.doc();
b.clear(doc);
doc.documentPreferences.properties = {
pageWidth: 110,
pageHeight: 110
};
var ellipseWithShadow = b.ellipse(10, 10, 10, 10);
// for the settings of the shadow take a look at
// http://yearbook.github.io/esdocs/#/InDesign/DropShadowSetting
ellipseWithShadow.transparencySettings.dropShadowSettings.properties = {
mode: ShadowMode.DROP,
noise: 0.5,
xOffset: 2,
yOffset: 2
};
b.fill(255);
// for the inner shadow settings see
// http://yearbook.github.io/esdocs/#/InDesign/InnerShadowSetting
var ellipseWithInnerShadow = b.ellipse(20, 20, 10, 10);
ellipseWithInnerShadow.transparencySettings.innerShadowSettings.properties = {
applied: true,
distance: 2
};
b.fill(0);
// http://yearbook.github.io/esdocs/#/InDesign/TransparencySetting/outerGlowSettings
var ellipseWithOuterGlow = b.ellipse(30, 30, 10, 10);
ellipseWithOuterGlow.transparencySettings.outerGlowSettings.properties = {
applied: true,
effectColor: doc.swatches[5]
};
b.fill(255);
// see http://yearbook.github.io/esdocs/#/InDesign/InnerGlowSetting
var ellipseWithInnerGlow = b.ellipse(40, 40, 10, 10);
ellipseWithInnerGlow.transparencySettings.innerGlowSettings.properties = {
applied: true,
effectColor: doc.swatches[5]
};
// http://yearbook.github.io/esdocs/#/InDesign/BevelAndEmbossSetting
var ellipseWithBevelAndEmboss = b.ellipse(50, 50, 10, 10);
ellipseWithBevelAndEmboss.transparencySettings.bevelAndEmbossSettings.properties = {
applied: true,
highlightColor: doc.swatches[5]
};
// see http://yearbook.github.io/esdocs/#/InDesign/SatinSetting
var ellipseWithSatin = b.ellipse(60, 60, 10, 10);
ellipseWithSatin.transparencySettings.satinSettings.properties = {
applied: true,
invert: true
};
// see http://yearbook.github.io/esdocs/#/InDesign/FeatherSetting
var ellipseWithFeather = b.ellipse(70, 70, 10, 10);
ellipseWithFeather.transparencySettings.featherSettings.properties = {
mode: FeatherMode.STANDARD,
noise: 10,
width: 5
};
// see http://yearbook.github.io/esdocs/#/InDesign/DirectionalFeatherSetting
var ellipseWithDirectionalFeather = b.ellipse(80, 80, 10, 10);
ellipseWithDirectionalFeather.transparencySettings.directionalFeatherSettings.properties = {
applied: true,
angle: 99,
leftWidth: 20,
rightWidth: 10
};
// see http://yearbook.github.io/esdocs/#/InDesign/GradientFeatherSetting
var ellipseWithGradiantFeather = b.ellipse(90, 90, 10, 10);
ellipseWithGradiantFeather.transparencySettings.gradientFeatherSettings.properties = {
applied: true,
hiliteAngle: 80,
hiliteLength: 10
};
// see http://yearbook.github.io/esdocs/#/InDesign/BlendingSetting
var ellipseWithBlending = b.ellipse(100, 100, 10, 10);
ellipseWithBlending.transparencySettings.blendingSettings.properties = {
opacity: 50
};
// you also apply al these things above only to the stroke or the fill
// http://yearbook.github.io/esdocs/#/InDesign/StrokeTransparencySetting
// http://yearbook.github.io/esdocs/#/InDesign/FillTransparencySetting
var rectWithBlendingOnlyOnStroke = b.rect(10, b.height - 20, 10, 10);
rectWithBlendingOnlyOnStroke.strokeTransparencySettings.blendingSettings.properties = {
opacity: 50
};
// code end ------------------
}
b.go();
This wiki is maintained by:
fabiantheblind
Thanks to:
- JohnDarnell for fixing lots of typos.
- jsp for fixing lots of typos.
- ltfschoen for fixing typos.
- wridgers for adding more links.
Thanks to the students from the seminar for asking all those questions and making me start this wiki.
- adinaradke
- AnitaMei
- ce0311
- coerv
- felixharle
- FerdinandP
- Flave
- marche
- monkian
- natael
- OliverMatelowski
- PDXIII
- praktischend
- schlompf
- skaim
You are awesome.
- Arrays
- Classes
- Comments
- Conditionals
- Functions
- Inspect Properties
- Loops
- Objects
- Output And Interaction
- Recursive Functions
- Inspect Properties
- Variables And Operations
- Extended JavaScript Guide
- Bridge Talk
- Create And Read Files
- ExtendScript Toolkit
- File
- Folder
- Includes JSX
- Object Watch
- Read In JSON From File And DONT Eval
- Storing Data In A Target Engine
- Target an application
- XML
- app
- Colorbrewer
- Colors And Swatches
- Delay And View
- Dialogs
- Documents
- Duplicate And Transform
- Event AfterSave
- Export IDML
- ExtendScript in InDesign Scripting DOM
- Fonts
- GeometricBounds and Coordinates
- Get named pageItems
- Graphic Lines
- Groups
- HSL Color Wheel
- Images
- Includes
- InsertionPoints
- Layers
- Line Feeds And Carrige Returns
- Masterspreads
- Matrix
- Objectstyles
- Outlines Groups Alignment
- Pages And Margins
- Pathfinder
- Placeholder Text
- Rectangles Ovals Polygons
- RulerOrigin
- Select words at insertionPoint
- Simple Find And Change Grep with FC Query
- Simple Find And Change Grep
- Simple Find And Change Text
- Spiro
- Styles
- Text Analysis ID FC
- Text Analysis
- Text Find Locations
- Text
- Transformation Matricies
- TransparencySettings
- XML creation and import