Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all 12845 articles
Browse latest View live

Copying colors between an object's fill and stroke

$
0
0

I need to set the (PANTONE) Stroke color of a filled path to a lighter tint of the Fill of the path item.

 

Is it as easy as :

 

    item.strokeColor = item.fillColor;

    item.strokeColor.tint  -= 15;

 

My problem is that I am new to ESTK Java scripting but have 25+ years of object oriented programming (C++, C# etc.) and in my mind the first statement makes the stroke color reference the same color objectas the fill, and hence the second statement changes the tint of the fill also.

 

What I observe when I try this is that the tint of the fill is not affected, but I am concerned that I am breaking something by having multiple references to the same underlying object.

 

Does the assignment of the color perform a deep copy of the color object?

 

Thanks


A list of Illustrator menu commands we can call from JavaScript.

$
0
0

app.executeMenuCommand(StringFromListBelow); 


actualsize

Add Anchor Points2

AddArrowHeads2

Adjust Colors Dialog

Adjust3

Adobe Action Palette

Adobe Actions Batch

Adobe AI Device center

Adobe AI Save For Web

Adobe Apply Last Effect

Adobe Art Style Plugin Other libraries menu item

Adobe Bridge Browse

Adobe BrushManager Menu Item

Adobe Color Palette

Adobe Color Palette Secondary

Adobe Default Workspace

Adobe Flattening Preview

Adobe Gradient Palette

Adobe Harmony Palette

Adobe Illustrator Find Font Menu Item

Adobe Illustrator Smart Punctuation Menu Item

Adobe Last Effect

Adobe LinkPalette Menu Item

Adobe Manage Workspace

Adobe Minimal Workspace

Adobe New Fill Shortcut

Adobe New Stroke Shortcut

Adobe New Style Shortcut

Adobe New Swatch Shortcut Menu

Adobe New Symbol Shortcut

Adobe Optical Alignment Item

Adobe Paragraph Styles Palette

Adobe Save a Version

Adobe Save Workspace

Adobe Stroke Palette

Adobe Style Palette

Adobe SVG Interactivity Palette

Adobe Swatches Menu Item

Adobe Symbol Palette

Adobe Symbol Palette Plugin Other libraries menu item

Adobe Transparency Palette Menu Item

Adobe Update Link Shortcut

Adobe Variables Palette Menu Item

AdobeAlignObjects2

AdobeBrushMgr Other libraries menu item

AdobeBuiltInToolbox1

AdobeCheatSheetMenu

AdobeLayerPalette1

AdobeLayerPalette2

AdobeLayerPalette3

AdobeNavigator1

AdobeNavigator2

AdobePathfinderPalette1

AdobeSwatch_ Other libraries menu item

AdobeTransformObjects1

AI Bounding Box Toggle

AI Magic Wand

AI Object Mosaic Plug-in3

AI Place

AI Reset Bounding Box

ai_browse_for_script

AISlice Clip to Artboard

AISlice Combine

AISlice Create from Guides

AISlice Create from Selection

AISlice Delete All Slices

AISlice Divide

AISlice Duplicate

AISlice Feedback Menu

AISlice Lock Menu

AISlice Make Slice

AISlice Release Slice

AISlice Slice Options

alternate glyph palette plugin

alternate glyph palette plugin 2

Appearance of Black 1

Apply Last Filter

areatextoptions

arrangeicon

artboard

assignprofile

average

avgAndJoin

bringAllToFront

Brush Strokes menu item

cascade

centerAlign

Character Styles

Check Spelling

cleanup menu item

clear

clearguide

clearTrack

clearTypeScale

Clipping Masks menu item

close

closeAll

color

Colors3

Colors4

Colors5

Colors6

Colors7

Colors8

Colors9

compoundPath

control palette plugin

convertlegacyText

convertlegacyText1

convertlegacyText2

convertlegacyText3

convertlegacyText4

copy

Create Envelope Grid

cut

Define Pattern Menu Item

deselectall

discretHyphen

Distort2

doc-color-cmyk

doc-color-rgb

DocInfo1

document

DropShadow2

Dynamic Text

edge

Edit Custom Dictionary...

Edit Envelope Contents

editGraphData

editMask

EditOriginal Menu Item

editview

enterFocus

Envelope Options

exitFocus

Expand as Viewed

Expand Envelope

Expand Planet X

Expand Tracing

Expand3

expandStyle

export

faceSizeDown

faceSizeUp

File Handling & Clipboard 1

File Info

Find and Replace

Find Blending Mode menu item

Find Fill & Stroke menu item

Find Fill Color menu item

Find Link Block Series menu item

Find Next

Find Opacity menu item

Find Reselect menu item

Find Stroke Color menu item

Find Stroke Weight menu item

Find Style menu item

Find Symbol Instance menu item

fitall

fitHeadline

fitin

Flash Text

FlattenTransparency1

Gradient Feedback

graphDesigns

group

guidegridPref

helpcontent

hide

hide2

hideApp

hideOthers

highlightFont

highlightFont2

hyphenPref

ink

Input Text

internal palettes posing as plug-in menus-attributes

internal palettes posing as plug-in menus-character

internal palettes posing as plug-in menus-info

internal palettes posing as plug-in menus-opentype

internal palettes posing as plug-in menus-paragraph

internal palettes posing as plug-in menus-tab

Inverse menu item

join

justify

justifyAll

justifyCenter

justifyRight

KBSC Menu Item

keyboardPref

Knife Tool2

Last Filter

leftAlign

Live 3DExtrude

Live 3DRevolve

Live 3DRotate

Live AddArrowHeads2

Live Color Dialog

Live Deform Arc

Live Deform Arc Lower

Live Deform Arc Upper

Live Deform Arch

Live Deform Bulge

Live Deform Fish

Live Deform Fisheye

Live Deform Flag

Live Deform Inflate

Live Deform Rise

Live Deform Shell Lower

Live Deform Shell Upper

Live Deform Squeeze

Live Deform Twist

Live Deform Wave

Live DropShadow2

Live Ellipse

Live Feather

Live Free Distort

Live Inner Glow

Live Offset Path

Live Outer Glow

Live Outline Object

Live Outline Stroke

Live Pathfinder Add

Live Pathfinder Crop

Live Pathfinder Divide

Live Pathfinder Exclude

Live Pathfinder Hard Mix

Live Pathfinder Intersect

Live Pathfinder Merge

Live Pathfinder Minus Back

Live Pathfinder Outline

Live Pathfinder Soft Mix

Live Pathfinder Subtract

Live Pathfinder Trap

Live Pathfinder Trim

Live Pucker & Bloat

Live Rasterize

Live Rasterize Effect Setting

Live Rectangle

Live Roughen

Live Round3

Live Rounded Rectangle

Live Scribble and Tweak

Live Scribble Fill

Live Transform

Live Twist

Live Zig Zag

lock

lock2

lockguide

LowerCase Change Case Item

Make and Convert to Live Paint

Make and Expand

Make Envelope

make mesh

Make Planet X

Make Text Wrap

Make Tracing

Make Warp

makeguide

makeMask

Marge Planet X

minimizeWindow

navigateToNextDocument

navigateToNextDocumentGroup

navigateToPreviousDocument

navigateToPreviousDocumentGroup

new

newFromTemplate

newview

newwindow

noCompoundPath

OffsetPath2

OffsetPath3

open

outline

Overprint2

pagetiling

Paint Tracing

paste

pasteBack

pasteFront

pasteInAllArtboard

pasteInPlace

PathBlend Expand

PathBlend Make

PathBlend Options

PathBlendRelease

PathBlend Replace Spine

PathBlend Reverse Spine

PathBlend Reverse Stack

PDF Presets

Planet X Options

pluginPref

preference

preview

Print

Print Presets

proofColors

proof-custom

proof-document

proof-mac-rgb

proof-monitor-rgb

proof-win-rgb

Punk2

quit

raster

Rasterize 8 menu item

redo

Registration...

Release Envelope

Release Planet X

Release Text Wrap

Release Tracing

releaseCropMarks

releaseguide

releaseMask

releaseThreadedTextSelection

Remove Anchor Points menu

removeThreading

repeatPathfinder

Replace Colors Dialog

revert

rightAlign

Roughen3

Round3

Rows and Columns....

ruler

rulerCoordinateSystem

Saturate3

save

Save for Office

saveacopy

saveas

saveasTemplate

Scribble3

selectall

selectallinartboard

Selection Hat 1

Selection Hat 10

Selection Hat 11

Selection Hat 2

Selection Hat 3

Selection Hat 4

Selection Hat 5

Selection Hat 6

Selection Hat 7

Selection Hat 8

Selection Hat 9

selectionPref

sendBackward

sendForward

sendToBack

sendToFront

Sentence case Change Case Item

setBarDesign

setCropMarks

setGraphStyle

setIconDesign

Show Gaps Planet X

Show Perspective Grid

Show Preprocessed Image

showAll

showAllWindows

ShowArtwork

showgrid

showguide

showHiddenChar

ShowNoArtwork

ShowNoImage

ShowOriginalImage

ShowPaths

ShowPathsAndTransparentArtwork

showtemplate

ShowTransparentImage

simplify menu item

sizeStepDown

sizeStepUp

snapgrid

Snapomatic on-off menu item

snappoint

snapPref

spacing

Stray Points menu item

Style Palette

SWFPresets

switchSelTool

switchUnits

systemInfo

Text Objects menu item

Text Wrap Options...

textpathtype3d

textpathtypeGravity

textpathtypeOptions

textpathtypeRainbow

textpathtypeSkew

textpathtypestairs

textthreads

threadTextCreate

tile

Title Case Change Case Item

toggleAutoHyphen

toggleLineComposer

Tracing Options

TracingPresets

tracking

Transform3

transformagain

transformmove

transformreflect

transformrotate

transformscale

transformshear

Transparency Presets

TransparencyGrid Menu Item

TrimMark2

Twirl Tool2

type-horizontal

type-vertical

undo

ungroup

unitundoPref

unlockAll

UpperCase Change Case Item

userInterfacePref

view1

view10

view2

view3

view4

view5

view6

view7

view8

view9

Welcome screen menu item

ZigZag2

zoomin

zoomin2

zoomout

Text Replacement script

$
0
0

Hello all,

 

I am very new to the scripting world but have an issue that I was unsuccessful in resolving myself through googling and searching around. It may be impossible due to illustrator's set up but I am looking for a script to find and replace strings of text throughout a document. I realize in indesign this would be easy as all get out, but due to other limitations I am forced to use Illustrator.

 

I would need the script to search and find strings in both text boxes and text objects (or 2 scripts could work). I would be looking for something to find and replace as well as style for instance, find AA and replace with AA(registration mark) and superscript the registration mark. I would need to be able to do this for multiple instances of this string on a document. Is something like this possible?

 

Thanks in advance!

Convert .ai to .doc

$
0
0

Hi,

 

Can it be possible to convert .ai file into .doc file or any tool which will do this conversion.

 

Thanks,

Shail

script to align selected objects to artboard

$
0
0

Hello, I was wondering if anyone had a simple solution to aligning selected items to the artboard. I was going to create an action but then realized it would be more convenient for me to include it in my script file....I have a script to align objects with each other but they dont align to the artboard. Any suggestions?

Can Adobe Customize 'SaveDlg()' to allow filter expressions on MAC OS

$
0
0

Hi , I am developing a project using Adobe Illustrator CC 2018 and Extendscript Toolkit on MacOS High Sierra. My doubt is :

Is it possible for Adobe to customize the 'SaveDlg()' file class function for macOS ,since one of the parameters of 'SaveDlg([prompt][,preset])' does not support filter expressions on MacOs using Extendscript ToolKit because of which I am not shown with the "File Format" field on Save As Dialog box written within Script folder of AI Shadow tool on MacOS.

Please help me out on this.

 

Thank You.

 

Message was edited by: Shruti Metta

 

 

[ moved from Adobe Creative Cloudto Illustrator Scriptingby moderator ]

XMP - Add keywords with script

$
0
0

Hallo Forum,

 

I would create a script to have keyword standards.

 

In EXCEL i create a controlled namespace trougth comboboxes to save the files in an controlled way. The Metadata should be a controlled way to avoid "phantasie"-names. Having this values I would insert this strings in the XMP:KEYWORD field. In this way with the bridge I can retrive the information.

 

xmp.string = word1, word2, word3, ...

 

I use VBA and at the moment I have this but it doesn't work.

 

Sub meta_add ()

dim w1 as string

w1 = "hallo world"

document.xmpString.add.w1

end sub

 

Somebody can help me with the basic? JAVA would be welcomed too !!!

Thank you

Form.JPG

How to embed multiple images

$
0
0

Hello!

 

I have been tying to figure out how I could easily embed multiple linked images easily. I have some 1000 .svg  images which have about 1-7 .tif images linked in to them. I now need to get those links embedded and becouse of the amount of images I'm hoping to make an action out of it. I have a script to embed single image in .svg but haven't have luck with multiple embeddings.

 

Any ideas?


Passing Variable via BridgeTalk

$
0
0

Hello,

I'm simply trying to send send 2 variables through BT to PS from IA to create a new document of the specified size.  Why isn't this working, please?  It works fine if I substitute numbers for the variables in the body of the script.

 

#target illustrator;

 

var artWidth = 100;

var artHeight = 100;

 

     

var bt = new BridgeTalk;

      bt.target = "photoshop";         

       var script = "app.documents.add(artWidth,artHeight);"       

       bt.body = script;

       bt.send();

 

Thank you for saving my sanity, again!

Script for randomly replacing symbols

$
0
0

Hi!

 

I'm looking for a script that will allow you to select some objects or symbols in your AI-file and then select some of your symbols from the symbols-library in your file and then randomly replace the original objects/symbols with the symbols selected. I have found a few scripts that does basically this but with random replacement of selected colours, transparency or angles but I need one for randomly replacing symbols.

 

Can someone help?

PageItem.applyEffect(LiveEffectXML)

$
0
0

I am wondering if anyone has been able to figure out what kind of "LiveEffectXML" is a parameter to PageItem.applyEffect()

It's been years since this feature has been out, but no documentation anywhere.

Script to crop artwork to artboard

$
0
0

I have some SVG graphics where the features/polygons 'hang out' over the edge of my artboard by a tiny amount. Is there a way (via script) of cropping all my shapes such that nothing hangs out over the edge of the artboard?

 

I have some script that creates a rectangle which is the exact size of my artboard. Using the menus (not script) I can then use that rectangle as a clipping mask over everything else which makes everything appear to be cropped, although what I'd actually like to do is properly, permanently modify all my polygons, rather than just having a visible clipping mask (and I need to do it all in script too). I'm then exporting the SVG files (hundreds of them) to DXF and what I don't want is coordinates of polygons that fall outside of the defined artboard boundary.

 

These are tesselating map tiles that are eventually making their way to GIS software to form a much larger map, so I don't want these little slivers of overhanging features as they end up overlapping each other at teh tile boundaries in teh final map.

 

Thanks!

How delete a Action Set in Illustrator by Script?

$
0
0

this my code Load and unload a Action in Illustrator. But Action Set [Test_Set_Action] still exist after unload .

oIllustrator.loadAction("C:\Test_Set_Action.aia")

oIllustrator.unloadAction("Test_Set_Action", "CVCMYK")

How delete a Action Set [Test_Set_Action] after unload by Script?

Or check [Test_Set_Action]  still exist?

illustrator script to fill a layer and repeat

$
0
0

im very new to illustrator and i have not done scripting before, i have like a hundred illustrator files that i need to change the background color lets say background color is layer 5 for every file, can scripting make it like repeat changing the background color for all my files, i would really appreciate some help with how to start writing a script, thank you

 

Capture.PNG

Accessing the Creative Cloud Libraries objects by script?

$
0
0

I have been scripting Adobe products for a few years, and I am utterly confused how to access the "Creative Cloud Libraries" through script? Are there any docs on how to get references to the objects? I would like to access my "Creative Cloud Libraries" by name, and access all the assets in that "Creative Cloud Libraries"?

 

Curious to know if anyone has figured out how to access the "Creative Cloud Libraries" through script?

 

Thanks!

Scott


How to encode non roman alphabet when exporting SVGs with ExtendScript

$
0
0

I want to encode non roman alphabets as greek, russian etc, when exporting SVGs, how could I achieve that with ExtendScript?

 

Thank you

How do I script a new position for an entire layer?

$
0
0

I have an 8x10 template but the artboard needs to be larger than the template's page size. I can open the template and resize the artboard to the larger size but the contents of the original template still need to be centered on the new artboard. The artboard is the right position, all of the original template's objects need to be repositioned.

 

With the GUI it's easy, just select the entire layer with the template contents and enter a new x,y position. In Javascript there is no position setting for an entire layer as a single unit.

 

Other alternatives I've tried:

 

  1. Create a new doc with the right size and use groupItems.createFromFile() for the template - centers the template: strips off the names of all objects and basically makes a hash of the original template. No good since I need those path and group names intact. Why couldn't it just work like Corel's import?
  2. Create a new doc, open the template, use copy and paste to copy template layers into the new document. Slow and uses up lots of memory. It works ok if there's a border around the template page that makes the centering work.It also works for multiple layers and centers the contents of all layers as a single unit.

 

One thing I can think of is that groupItems can be positioned so I could put everything in the layer into a single group and move that new group and then move everything back out of the group. This doesn't work for multiple layers unless I want to merge them (which I don't).

 

Any other suggestions on positioning the contents of one or more layers to be centered on the page? Multiple layers would need to keep their original relative positions.

Copy artboard (and art) to another document

$
0
0

Is there a way to write a script to copy a selected/chosen artboard (and it's contents) to another opened document, placing it in exactly the same place on the global x/y coordinates?  I'm either unable to find this feature built in to Illustrator, or it's simply missing.  Any help is greatly appreciated.

 

Thanks!

Tim

Script - Create a small circle at the corner of the artboard

$
0
0

Can someone help me or guide me to the right direction of how to do this?

 

Basically, this is what I want the script to do

 

1. Make artboard the size of my selected artwork + 1" offset

2. Create a circle at each of the corner of the artboard

 

I figured out the script for #1 but I can't find figure out #2. Could anyone help?

 

Thanks in advance

Delete Multiple Layers via Script

$
0
0

This should be fairly easy, I have tried to make one myself, but haven't gotten it right yet.

 

What I need to accomplish:

Have a script delete Layers by name, even if locked / hidden / have sublayers with art.

 

Example Layers:

Anchor Point

Center guides

Original

 

Also something not case sensitive would be preferable.

 

I started by just repeating this "app.activeDocument.layers.getByName('Anchor Point').remove();" with the different layers typed in, but it errors out when it tries to remove a layer that's not there in the specific file.

Viewing all 12845 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>