Illustrator Scripting :: Create Symbol From Layer PageItems

Mar 25, 2011

How to create a single symbol from all the objects within a single layer.
 
Despite what the reference docs say, it doesn't seem that PageItems is a valid argument to pass into Symbols.add()... 
 
Some example code?

View 7 Replies


ADVERTISEMENT

Illustrator Scripting :: Move PageItems From One Layer To Another?

Dec 19, 2012

I am working on a script to standardize layers and I need to move all the pageItems from a layer called "PART_NUMBER" to a layer named "STATIC".
 
following code at the arrow...
 
I am using "test" to troubleshoot the move.
 
standardizeLayerNames() // This function verifies that the Layer names conform to the standard Layer names.
function standardizeLayerNames()      {  
var myDoc7=app.activeDocument  
var myLayerCount7 = myDoc7.layers.length

[Code] ........

View 4 Replies View Related

Illustrator Scripting :: Using Javascript And ScriptUI To Create A Form That Brings In Symbol From Library

Feb 25, 2012

I've been trying to pull together the right info to use JavaScript to create a form to bring in particular symbols from the symbol library based on the variables taken from the form. I've taken bits and pieces from various sample scripts and tried to make this work, but my problem appears when I try to use conditionals.This is a limited version of what I want to do, but it is enough to get the point across.
 
1. I want to select a script that has various dropdown boxes. I would like the first dropdown to give me 3 options: 10, 13, 18
2. I would also like another drop down box that gives me three more options: single needle, double needle, and knife edge.
3. I would then like it to have an "ok" button and "Cancel" button.
4. From here when I click the ok button, a symbol is brought in from the library depending on what parameters were given to the form.
 
ex. If I selected 10 in the first drop down and double needle in the second, I would like "SYMBOL A" to be pulled from the library and centered on the artboard.ex. If I selected 13 in the first drop down and double needle in the second, I would like "SYMBOL B" to be pulled from the library and centered on the artboard.
 
I've gotten the UI to pop up and it works as planned as well as bringing in a symbol, my problem comes when I try to incorporate conditionals and functions.Here is my script.
 
var myDoc = app.activeDocument;var Pallette = new Window ("dialog", "Create a Shell"); Pallette.add ("statictext", undefined, "Fill Opening in Inches:"); Pallette.orientation = "row";var myDropdown =  Pallette.add ("dropdownlist", undefined, ["10", "13", "18"]);myDropdown.selection = 1;var myButtonGroup =  Pallette.add ("group");myButtonGroup.orientation = "column";var btnCreate = myButtonGroup.add ("button", undefined,
[code]....

View 11 Replies View Related

Illustrator Scripting :: Symbol To Be Placed In EPS File?

May 21, 2013

I need to place a logo at the bottom of the image in eps.
 
i have created the logo as symbol, can this symbol could be placed at the bottom of the image.

View 3 Replies View Related

Illustrator Scripting :: Break Link To Symbol

Feb 5, 2011

If I right click on a symbol instance, I get a menu item, "Break link to symbol."  How can I do that same thing in Javascript?
 
1) That is, how do I use Javascript to break the link between a SymbolItem and the Symbol it represents? (i.e. without deleting the Symbol?)
 
2) Once the link is broken, how do I locate the Layer that was created when the link was broken?  That is, once the link is broken, it is no longer a SymbolItem; it becomes a Layer instead.  How do I locate that Layer?
 
3) How do I convert the Layer to a GroupItem?

View 5 Replies View Related

Illustrator Scripting :: Replace GPS Points With A Symbol

Dec 19, 2011

So I am trying to replace gps points with a symbol I have created. I have found blogs referencing a script that can replace selected items with symbols saved in the symbols panel, but I can't seem to find the actual script! Where I can find JET_ReplaceWithSymbol.jsx or any other script that can do the same function.

View 21 Replies View Related

Illustrator Scripting :: How To Add Methods To The Symbol Items Class

May 31, 2012

is there a way to extend existing classes? I am trying to add methods to the symbolItems class, but it doesn't seem to work. says it is not defined:
 
symbolItems.prototype.isIn = function(parentItem, runThis) {
//do something
}

View 5 Replies View Related

Illustrator Scripting :: Deleting Used Symbol Generates Error

May 31, 2012

I'm having difficulty writing a script that deletes all of the symbols in the document (as opposed to just breaking links or expanding which I apparently cannot do). app.sourceDocument.symbols.removeAll();When it reaches a symbol that's used in the document somewhere it spits out this error: Error 1200: an Illustrator error occurred: 1346458189 ('MRAP')

View 11 Replies View Related

Illustrator Scripting :: Swap Symbol Instance By Changing Its Name?

Aug 11, 2012

I'm trying to swap symbols in situ by changing the 'name' property of the symbol instance.
 
My rudimentary script can find the existing symbol name (for me, that's a small triumph!). The Illustrator document has two symbols in the Symbols panel, 'blue_square' and 'red_circle'. I run the script with an instance of 'blue_square' (and nothing else) on the page, and try to change the name to 'red_circle':
 
var docRef = activeDocument; 
var symbolitem = docRef.symbolItems[0]
 var symbolname = symbolitem.symbol.name; 
var newname = "red_circle";
symbolitem.selected = true; 
// this next line causes the problem:
symbolitem.symbol.name = newname;
 
This causes an error - 'the name is in use'.

View 14 Replies View Related

Illustrator Scripting :: Fill A Shape With Instances Of A Symbol?

Sep 6, 2012

I'd like to fill a shape with instances of a symbol. The sybmols should vary in size but never touch each other or the outer edges of my shape. Is there a script that can do this?

[URL]

View 1 Replies View Related

Illustrator Scripting :: How To Break Symbol Link By Script

Sep 12, 2013

How to do it ?

View 4 Replies View Related

Illustrator Scripting :: Find And Replace Symbol Content

Nov 18, 2013

I have multiple documents using text as symbols. I need to change a ® 2013 to  a ® 2014 within the symbols. Without having to go into each document and double click on the symbol or break the link, is there a way to do a batch find and replace that will search within symbols to change text?

View 2 Replies View Related

Illustrator Scripting :: Adjust 9 Slice Scaling Guides Of Symbol By Script?

Sep 19, 2013

How to adjust 9 slice scaling guides of symbol by script?

View 1 Replies View Related

Illustrator Scripting :: Symbol Is Within Rectangle Vector Area / Parent Child Relationship In HTML

May 30, 2012

I think the execution would be relatively easy. how to tell detect if a symbol is within a rectangle vector area. so almost like a parent child relationship in HTML goes? was thinking about getting top bottom left and right of a layer called parent then checking all layers below it (maybe they have "child" naming scene, so i can match by layer name) if the top bottom left and right are >=/<= the one above it. so it is basically detecting if a box is inside another box.

URL...need to detect is symbol1 is within div1 or 2 and same with symbol2

View 4 Replies View Related

Illustrator Scripting :: Write A Script That Renames A Layer And Group Within The Layer?

Jul 25, 2013

I'm trying to write a script that renames a layer, and group within the layer, then an object within the layer (but not a part of the group) and have it run in a loop.
 
Here's what I've got so far, the group rename doesn't work.
 
 #target Illustrator 
var doc = app.activeDocument;
 idLayers(doc)//IRename layers
idGroups(doc)//Rename groups
 function idLayers(doc){

[code]....
 
I haven't put in anthing to rename the single object yet since I cant even get the group rename to work. I suspect that the group re-name section isn't working because I'm either using bad syntax or an invalid command.

View 3 Replies View Related

Illustrator Scripting :: Create Mirror Text And Stroke Text In AI Scripting

Mar 16, 2013

the Script of creating mirror text and stroke text in Adobe illustrator scripting.

View 4 Replies View Related

Illustrator :: Layer Status Keeps Expanding When Symbol Is Selected?

Jul 26, 2012

I am using CS5 and was forced into a workflow where everyone is using icons from the symbol library (web symbols to be exact). They are not being used as "symbols" per se, just icons. The standard procedure is to drag a symbol to the artboard and then "break link" with the button.
 
This sounds fine in theory but now everytime I click on this icon, my layer status is expanded (totally annoying).
 
This is completely recreatable from machine to machine.
 
why unlinked sybols would cause the layer dropdown to expand? (or how to avoid it)

View 1 Replies View Related

Illustrator Scripting :: How To Delete Layer

Apr 3, 2012

I am writing my own Illustrator scripts.
 
How do I write a script to delete layer with ".ARD" name.

View 8 Replies View Related

Illustrator Scripting :: Import PSD To AI Layer

Sep 8, 2012

I am new to scripting in Illustrator.I am trying to import PSD files into an AI layer.So far this is my solution.
 
var TRGdoc = app.documents.add(DocumentColorSpace.RGB, "1920", "1080");
var onFile = File( '~/Desktop/jpeger/illDanceREFon_00642.psd' );
var REFon = app.open(onFile);
var LAYon = REFon.layers[0];
var LAYstuffon = LAYon.pageItems[0];
LAYstuffon.selected = true;
app.copy();
TRGdoc.activate();
var TRGlayer = TRGdoc.layers[0];
TRGlayer.selected = true;
app.paste();
 
It works most of the time but sometimes it hangs up on the paste. 

View 4 Replies View Related

Illustrator Scripting :: How To Script Using Highlighted Layer

Dec 19, 2012

Is it possible to script using a highlighted layer.
 
I know that selected items can be used for scripting, but I would like to just highlight the layers I want to process but not directly select the items on those layers.

View 2 Replies View Related

Illustrator Scripting :: Delete Some Text From Layer

Jan 3, 2013

what is the script to delete some letters from layer?For ex. I've "Layer XYZ" and I want "Layer XY".

View 9 Replies View Related

Illustrator Scripting :: Making Layer Visible By Its Name?

Mar 3, 2013

How to make a layer visible by using the name of the layer, with javascript?

View 2 Replies View Related

Illustrator Scripting :: How To Rename The Created Layer

Sep 27, 2012

I create with VBA an Illustrator sheet with custom size:
 
'define size
Dim B_cust, H_cust As Integer
Set appRef = CreateObject("Illustrator.Application")
B_cust = CInt(InputBox("B=", "Higth:"))
H_cust = CInt(InputBox("H=", "Width:"))
Set newDocument = appRef.Documents.Add(aiDocumentCMYKColor, B_cust, H_cust)
 
This works fine
 
I would have fore each new document the same layer order like

cadsymboltext 
Rem ###new Layer###
Set myDoc = appRef.ActiveDocument
Set myLayer = myDoc.Layers.Add()
Set myLayer.Name = "cad"
 
I'm not able to rename the created layer ?

Furthermore I would erase the default Layer LEVEL 1

View 1 Replies View Related

Illustrator Scripting :: Create CDATA In XML?

Dec 17, 2013

What if for some reason a person wants to actually make an XML file and stick some <![CDATA[]]> in it? I looked through some manuals & OMV fairly quickly to discover no methods for that. Was wondering if there was some technique.And, just as pointed out in the indesign forums, a string of "]]>" makes the script hang up and debugging have to be stopped with the final message "Cannot execute".

View 9 Replies View Related

Illustrator Scripting :: Turn On Layer Visibility Without Exact Name?

Jan 4, 2013

I am realtively good with actionscript, so I am trying my hand at this to streamline our image exporting process. I am using CS5 on a PC.
 
We build our illustrator files to be a combination of different layers. Sometimes just one layer is exported at a time, and sometimes layers are combined to form a more complex image. We use layer names with instructions of what layers should be on and off.
 
An example of the layer naming might look like this:
 
03 (01-ON, 02-OFF)
02 (01-OFF)
01
 
I have been able to figure out how to check if there is a note to turn a layer on, my question is how do I select the layer to turn on the visibility without using the exact name of the layer?
 
In my example, when layer 3 gets exported, it should have layer "01" visible and layer "02 (01-OFF)" not visible. Since our files are always constructed differently (meaning 02 might not always have a note about 01 being off), I can't use the getByName option because I don't have an exact name to call the layer and turn the visibility on. The layers always start with 01, 02, 03, etc. Is there a way to use getByName and only have it look at the first 2 characters of the layer name?

View 8 Replies View Related

Illustrator Scripting :: Test Whether A Layer With A Specific Name Exists?

Dec 27, 2010

Is there a simple way to test whether a layer with a specific name exists?

View 9 Replies View Related

Illustrator Scripting :: Moving All Layers Into Single Layer

Nov 20, 2013

I'm new in scripting and i need to make a script that moving all layers into a single layer (in Illustrator i press CTRL+A then CTRL+G in layers and works) but i need that in script.

View 2 Replies View Related

Illustrator Scripting :: Change Active Layer Name Same As Document Name

Sep 30, 2013

I would like to make the active layer name the same as the document name.  I know very little about scripting.  I found this script:
 
var idoc = app.activeDocument;var ilayer = idoc.activeLayer;var filename = idoc.name;ilayer.name = filename;
 
It does almost what I need it to do. except that it also copies the ".ai" in to the layer name.  Is there some way to modify this script to have it exclude or delete the file extension?

View 4 Replies View Related

Illustrator Scripting :: Iterate And Remove Objects In A Layer

Apr 9, 2013

I am trying to iterate through objects in a layer and if the object satisfy a condition, I want to remove it.
 
Problem is that from what I suspect, if I use a "for loop" then when I remove an element, the initial length of the loop becomes invalid by removing the element. So what I would need is to iterate through objects in another matter and I am clueless.

View 3 Replies View Related

Illustrator Scripting :: Assign Default Colors To New Layer?

Aug 7, 2013

Is there a way to assign one of the default layer colors with javascript? like light blue, light red, or green.

View 3 Replies View Related

Illustrator Scripting :: AppleScript Placing Page From PDF Into Layer

Sep 20, 2012

I have a PDF file with 25 pages that I need to get into the form of an Illustrator file with 25 layers. I found the example of opening a particular page of a PDF file (using CS6), and that works. And I can create layers. But I can't figure out how to place a particular page of a PDF file into the new layer. Where/how do I provide the page info?
 
(I have a PostScript program that generates artwork for signs that are to be laser etched at the TechShop. The laser interface uses Illustrator and a special Print driver. I notice that opening a page from a PDF file positions the contents slightly differently than placing that page, when I do it manually, so I figured I'd create the multilayered Illustrator file by opening one page (which works) then placing all the pages in their own layers, then deleting the first page. Then the positioning will be consistent. But I'm stuck at placing a PDF page...)
  
tell application "Adobe Illustrator" to activate

-- This function opens the file passed as
-- a file reference parameter, at page myPage.
-- fileToOpen is a reference to a multi-page PDF file
-- and needs to be set up before calling this function.

on openMultipageFile(fileToOpen, myPage)
tell application "Adobe Illustrator"
set user interaction level to never interact

[Code].....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved