OVERLAP OBJECTS
Selections to Artboards ?
Is there any script that can take a selection or multiple selections and make artboards from those selections and so the artboards fit perfectly to the selection ?
Automatically check spelling
Hi,
I am new to scripting. I am desperately need help from anyone that could guide me with some scrip that i can use to enable illustrator CC to automatically check spelling just like it does in Indesign.
May be this is a little too much to ask, but your help mean so much to me.
Thank you.
Export file as a DXF
My script is working nice until I try to export my document. I am trying to export my document as a DXF file. Using the Illustrator CS6 Scripting Reference I am using the TIFF export as a reference as there are no examples for exporting as a DXF (my luck!). This is what I have in VBscript. With this script I get the following error on the second to last line:
"Illegal argument - argument 2 - Enumerated value expected"
As you can see I do have one: "0" so I suspect the error lies elsewhere in the code? I'll take a JavaScript example if you are not into VBscript since the two look very similar and I think I can adapt it.
Set App = CreateObject("Illustrator.Application")
Set FSO = CreateObject("Scripting.FileSystemObject")
Dim dest
dest = "S:\SOCAL\Section_32\Veg DXFs LC\SOCAL_CK67_pineLC"
Set DXFexport = CreateObject("Illustrator.ExportOptionsAutoCAD")
If App.Documents.Count > 0 Then
Set docRef = App.ActiveDocument
Call docRef.Export (dest, 0, DXFexport) ' 0 = aiDXF
End If
fill color using a script.
I'm trying to create a script in CS5 mac os10.6.8 that will change the fill color of selected pathItems. I need a simple script that will change a selected pathItem to cmyk values 2,3,15,0. I will then select this script and implement the action in a batch of 600 files.
I wish this process could be recorded as an action but when I record the action "add new swatch" I have to manually input the cmyk values, which will take forever for a batch of over 600 files.
Select an object in illustrator using extendscript
I have a drawn rectangle on an illustrator document. In the layers menu I have given it a specific path name (outerBox). I would like to select this item and return its particular properties eg height, width, colour etc. How would I do this.
Thanks
Bob
Is there a collection of free commonly useful scripts?
I know about the various sample scripts, but does there exist a source of open and free scripts that are popular?
Overprint on outlined text
So I looked around but could not find anything on here. I basically have a script that needs to select 3 text objects, then outline them, then set the group to overprint. I have been getting close to solving it, but I can't really figure out the overprint part. I was hoping that it would carry over if I set the text as overprint before I outlined them, but it didn't help. so I basically need to set the overprint on a Group, or I could loop through and set the overprint on the compound paths inside that group. any ideas?
How to script the 'Export as...' feature?
I want to export artboards as PNG files in a JavaScript. In the past I used the ExportOptionsPNG24, but font comes out fussy in small sizes.
Is there a way to script the export-as-feature in Illustrator? (File > Export as > PNG with artboards and anti-aliasing/Type optimized)
I haven’t found anything in the scripting reference 2017:
Any hints welcome. I just want to know, if it's possible. No need for a final script. ;-)
A list of Illustrator menu commands we can call from JavaScript.
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 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
Export multiple PDF Presets in Illustrator
When exporting projects, we use a number of PDF (and image) presets to create print ready files, proofs, and web files. The Export for Screens feature will not allow us to export multiple PDF Presets (i.e. export print ready PDFsat the same time as smallest file size PDFs). Is there a script I can use to get this much needed feature?
Much obliged,
Aadam
Creating a dynamic action to use with app.doScript() method.
Since building dynamic actions is a topic unto itself, we often search for a reference thread to show somebody how to do this - and we often do so while trying to discuss work which is already involved and has nothing to do with actions or loading and playing them. Therefore I'm creating this thread to show an example and I'll paste the url to it when such questions arise.
Sometimes in Illustrator scripting we need to accomplish tasks which (sometimes counterintuitively) do not have scripting access via the DOM.
Fortunately since Illustrator CS6, they gave us the ability to play an action from a script with the app.doScript() command - which is not at all the same as Indesign's function of the same name. This one lets you play an action that exists inside the Actions panel. Immediately this may seem disappointing as users cannot be counted on to have specific actions at any given time.
However, they also gave the ability to load and remove actions from .aia action files. Your .aia file just needs to be somewhere and app.loadAction() can read it right into the Actions panel. Same with app.unloadAction(setName, actionName) - where (thanks to qwertyfly) using (setName, "") an empty string argument for the action name will remove the entire set. And when you try to remove an action that does not exist, well, it throws an error - which is how you can check for making absolutely sure that an action set is completely removed.
This may seem like a lot of work - to write a file, read it, play it and then discard it, often to do something that you'd think scripting should do in the first place.
Sometimes the action alone is enough to satisfy an objective - such as changing the document color mode. Other times it is necessary to alter actions in order to get use out of them - such as when you try to create a routine for saving a high-resolution "Export" JPG that is different in output and options form the "Save for Web" JPG. You may want to change some of the parameters such as resolution or the actual destination of the file.
Here is how you can do this.
First, record your action as you would normally: record a new set with a new action, call them what you need and then in the Actions flyout menu, save out a .aia file where you can find it. You can open the file in a text editor and read the contents - they are lines of special Actions 'code' which contains some cryptic text.
There are lines which look like a bunch of gibberish characters, they are hex-encoded strings for some parameter item which are strings, and they contain above them a number to signify the amount of characters inside the encoded string. (this is important later because this number also needs to be set properly when you put your own value in there) Other parameter items are simple numbers, but their keys are still obscured.
The truth is, while the string parameters are hexadecimal-encoded, the keys are both hexadecimal and decimal encoded! So if you wanted to know the special 4-letter keys, you'll have to run those through two decoder routines.
Next, you will need to put this entire string into your script and use some string-replacement or string-building to put your own data in those places of the action string where they matter. For example, putting your own file path into a save action.
And, after that you need to write a procedure for writing this new altered string to the file system and loading it into your Actions panel. Mind you, to leave things "as they were" you would need to remove the .aia file and the action that you have loaded.
Let's try with the save-a-jpeg workaround!
Here is the .aia string which is recorded from an Export JPEG action.
/version 3
/name [ 8
5475746f7269616c
]
/isOpen 1
/actionCount 1
/action-1 {
/name [ 11
4578706f7274204a504547
]
/keyIndex 0
/colorIndex 0
/isOpen 1
/eventCount 1
/event-1 {
/useRulersIn1stQuadrant 0
/internalName (adobe_exportDocument)
/localizedName [ 9
4578706f7274204173
]
/isOpen 1
/isOn 1
/hasDialog 1
/showDialog 0
/parameterCount 7
/parameter-1 {
/key 1885434477
/showInPalette 0
/type (raw)
/value < 100
0a00000001000000030000000200000000002c01020000000000000001000000
69006d006100670065006d006100700000006f00630000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000100
>
/size 100
}
/parameter-2 {
/key 1851878757
/showInPalette 4294967295
/type (ustring)
/value [ 25
2f55736572732f566173696c7948616c6c2f4465736b746f70
]
}
/parameter-3 {
/key 1718775156
/showInPalette 4294967295
/type (ustring)
/value [ 16
4a5045472066696c6520666f726d6174
]
}
/parameter-4 {
/key 1702392942
/showInPalette 4294967295
/type (ustring)
/value [ 12
6a70672c6a70652c6a706567
]
}
/parameter-5 {
/key 1936548194
/showInPalette 4294967295
/type (boolean)
/value 1
}
/parameter-6 {
/key 1935764588
/showInPalette 4294967295
/type (boolean)
/value 1
}
/parameter-7 {
/key 1936875886
/showInPalette 4294967295
/type (ustring)
/value [ 1
32
]
}
}
}
We can see many parameters and their various cryptic blocks, but what you want to do is decode as many /type (ustring) elements as possible to get a sense of what the action is doing. At this website, you can do this fairly easily although tediously: Convert Hexadecimal To String Online
For example: "4a5045472066696c6520666f726d6174" turns into "JPEG file format".
In this action example, I am not worried about changing the other parameters dynamically - I'm assuming the settings used in my action are suitable for my purposes such as resolution being 300 for all time. The part I'd like to change is my file path so that my JPEG goes to the right place.
/value [ 25 | ||||
2f55736572732f566173696c7948616c6c2f4465736b746f70 | ||||
] |
This line yields: "/Users/VasilyHall/Desktop"
So this is the line I'll need to replace.
Before anything else - here is how I'd embed the action string with ease. Using a text editor like Sublime text which lets you put many cursors down at one time, I can paste the action string in and find every nextline character. Then it's easy to highlight each line and put quotes around it as well as a comma in the end, or plusses - depending if you want to store the string as an array or a plain string in the script.
I find the plusses a little cluttering so I opt to use this format:
var actionString = [ "string",
"string"
].join("\n");
So my dynamic portion of the string which will be used with string replacement would look like this:
" /value [ {{number_of_characters}}",
" {{hex_encoded_path}}",
" ]",
When the action is ready to be dispatched, a string replacement would look like this:
var myNewPath = Folder.myDocuments.toString() + "/Destination";
var myNewPathEncoded = hexEncode(myNewPath); // find a hex encode function via google
var thisActionString = actionString.replace("{{hex_encoded_path}}", myNewPathEncoded).replace("{{number_of_characters}}", myNewPath.length);
Now it's time to write the file.
var f = File(actionFileLocation);
f.open('w');
f.write(thisActionString);
f.close();
And now it's time to load the action.
app.loadAction(actionFileLocation);
Now we can play the action.
app.doScript("Export JPEG", "Tutorial");
This should save your jpeg, and as of this writing, this is the only way to get the JPEG export which isn't the Save-for-Web variety.
But, let us not forget the cleanup.
Remove the .aia file:
f.remove();
Remove the single-use dynamic action:
app.unloadAction("Tutorial", "");
There you have it: building dynamic actions to do simple and non-simple things, which regular scripting just can't do.
Splitting the array into pairs.
Hi,
I have array with numbers and i want to create pairs from this table, like this:
var doc = app.activeDocument;
var table = ["1", "2", "3", "4", "5", "6", "7", "8", "9","10"]; // the table will be variable so the number of pairs will be variable too there can be 2-4 numbers and it can be 30.
//some magic function or loop
var pairs = {
1. pair = ["1", "2"]
2. pair = ["2", "3"]
3. pair = ["3", "4"]
4. pair = ["4", "5"] etc.
} ;
Need a Illustrator script writer.
Hello there,
Is there anyone who can help me in writing a illustrator script?
Batching In Illustrator??
In PhotoShop CS3, you can select File/Automate/Batch, and run an Action on an entire folder. I don't see that option in Illustrator CS3? Is there a way to run an action on an entire folder?
I'm attempting to save many EPS images as PNG images, and would really like to retain "vector attributes" - is any of this possible???
Thanks for any help.
OVERLAP OBJECTS
How to delete specific layers?
Hi,
I have a large batch of files (100+) that all have the same layer structure. The top layer is called 'Guides', the next layer is called 'Object", the next layer is called 'Shadow' and it goes on down through another 5 layers. I'd like to create a script that will select delete certain layers (eg. 'Guides') before I save out a new file as part of an action. I'm coming from a background in Photoshop, where this could all be done in actions, but appears you can't select layers in Illustrator (please correct me if I'm wrong!).
Any help in creating a script would be most appreciated!
Dave
How to make scripts for aligning objects?
Hey,
How would I proceed to create scripts for aligning objects? Basically what I want is to keybind the buttons for the Horizontal and Vertical align -icons.
In Photoshop you can use the ScriptListener but there doesn't seem to be anything like it for Illustrator. Illustrator also seems to have a totally different scripting structur!? I tried running a Photoshop script in Illustrator and it complains about charIDToTypeID() and stringIDToTypeID() not being valid functions.
Document preset & New document - Illustrator - Applescript
Hi !
Here is the problem i would like to resolve with appelscript.
I want to make a new file with units (millimeters)
I know i need to make a preset before making a new document ; but i don't know how to do !
Here is a part of the code i tried to do :
tellapplication "Adobe Illustrator"
activate
setdocument unitsofdocument presettomillimeters
makenewdocumentwith properties {width:297, height:210}
endtell
Thanks for your help !
assign text through java script
Hello All,
This question might have been asked earlier but i couldnt find a clear cut answer to this. So here goes. i am trying to localise an image across different languages and though it was best to use illustrator capabilities. For this purpose i wanted to create the image file and leave the test fields empty and make them dynamic. The idea is to then run a Javascript from illustrator that would essentially populate the dynamic text field from an external data source. However i am not able to manually create such text placeholder on the illustrator file which can later be accessed as a variable from the javascript. Any help would be greatly appreciated.
Note: I know this can be done by importing it to flash and then setting the variable using the actionscript but i was hoping to tackle the problem from the illustrator side itself
Thanks a ton