Illustrator Scripting :: Delete Document Using JSX?
Jan 8, 2013I want to delete an Image File using JSX .
I explored the functions in File but there is nothing like Delete().
I want to delete an Image File using JSX .
I explored the functions in File but there is nothing like Delete().
Any success creating a script that delete elements in Illustrator by its colors?
For example, I want to delete all elements that is colored Red in a document regardless what layer or artboard thay are in.
I am writing my own Illustrator scripts.
How do I write a script to delete layer with ".ARD" name.
I'd like to export certain properties from an ai-document to XML. The XML will be post-processed using XSLT. Secretly, I'm hoping that I can invoke the Reflection-system (as mentioned brifely, I might add) in the ExtendedScript Toolkit CS6 Core JavaScript Classes.
How to get reflection working for JavaScript objects (both built-in and the ones I've created in code my self)? Are there any guides that are relevant in my case? (Try googling "illustrator script reflection" and you get a bunch of flip object scripts ...)
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.
View 35 Replies View RelatedI have around 300+ files in eps format but i need them to convert it to word format.
Any options availble.
I have tried the eps to pdf and convert the pdf to word, but this doesnt worked for me.
I am writting in extended javascript to convert .ai document into HTML/CSS. for Placed image item i want to wirte css data. but the url of image path i am getting from the placedItem is : '~/Desktop/AdobeIllustrator/home.jpg' when the same path i am using in my css like :
.imageParameter
{
background-image: url('~/Desktop/AdobeIllustrator/home.jpg');
}
but the browser is not able to locate the image.
What is the javascript to add a new artboard to an existing Illustrator document?
View 2 Replies View RelatedAs I understand it, TextFonts is a collection of all fonts available to Illustraot. Is there a collection of all fonts used in the open document? Or would I have to step through every textFrame an create that list myself?
View 8 Replies View Relatedhow to lock items in a document?, I saw lots of tips on how to know if the object is locked, but I did not find tips like locking them.
View 2 Replies View Relatedwhat is the script to delete some letters from layer?For ex. I've "Layer XYZ" and I want "Layer XY".
View 9 Replies View RelatedI 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?
I am working on a plugin application, in that saving Image files on a specific location by using JSX file.I have done with that but it works only with local drive.I want to save that file on my Network Share by using JSX.
View 10 Replies View RelatedI'm a designer and i know nothing about scripting. But actually i would like to remove a bunch of text. I am working on a map, and i need to get rid of all text in parenthesis (the parenthesis included in). I know there will be a faster and efficient way to do it by scripting, but i don't know how to get to that.
View 3 Replies View Relatedin an open PDF File i press 'Ctrl+A' to select all Items in the document, then i choose Edit/Transform/rotate ... 90 degree.now i'd like to do the same with an vbscript.
the best thing i could find is:
rotate(90)
Sub rotate (degree)
Dim appRef, argument, element
Dim changePositions, changeFillPatterns, changeFillGradients, changeStrokePattern, rotateAbout
Set appRef = CreateObject("Illustrator.Application")
[code]....
not all, but all elements i am interested in are rotated - it would be better if really all elements would be rotated the elements are rotated around 'aiTransformDocumentOrigin' ... i would prefer if they are rotated around 'middle of document'.
is there a way to determine the biggest item in a document using javascript?
View 4 Replies View RelatedScript which would convert the layers in a document to artboards? At present I have a lot of documents with a couple of hundred layers on each of them, but I've decided to change the way that I organise my workflow and started using artboards instead. I don't really have the time to spend moving them individually from a layer over on to an artboard as there are a lot.
View 1 Replies View RelatedI need to generate an overview of the colors used in a document.
For that, I would like to cycle through several rectangles of which I know the exact size. The rectangles are filled with a color from the swatch palette.
What I try to achieve is that the swatch name of the rectangle's fill color is written to a text field directly above the rectangle. But I could not find a possibility to 'extract' the fillcolor from a pageItem into a pastable string.
Is there a way to do this with Illustrator and Javascript?
I'm trying to inverse all gradients within a document using Javascript. I can't find the property to call to inverse them in any of the PDF's I have, and I'm having trouble calling gradients in general I can't even rename them at the moment.
View 3 Replies View RelatedI am trying to create a script to specify a percentage of the selected items you want to remove.Here is what I have so far.
I still need to work out on the alert prompt and the if statement, but for now, I have the feeling that the selection.length keep changing each time Illustrator delete an object, and I don't know how to make it stick.
var selection = app.activeDocument.selection;
//alert prompt dialog for a percentage of deletion
for (var i = 0; i < selection.length; i++) {
if (Math.random < 0.5) { //need to work out the percentage
alert("yes")
selection[i].remove();
}
}
Im trying to delete unsued document profiles, but after deleting they are recreated every time i start Illustrator. How can i delete them permanently ?
View 10 Replies View RelatedI'd like to create a script that checks the current document's color profile and checks it against a string, for example "sRGB IEC61966-2.1". My studio has a script that performs various functions to make sure that all the layers are visible/unlocked, checks for stray points, etc., and we'd like to add a check to the color profile because we handle a large number of files and this setting is overlooked a lot.
It's alright if this value isn't writable through script (we can just pop up an alert letting the user know that they need to change it), but I can't find where to actually read this setting! We're currently working on Macs and with JavaScript, but any nudge in the right direction.
I'm trying to select every object with the color "CutContour" So far I've been trying:
myDoc.selection = myDoc.spots.getByName("CutContour"); I guess this obviouslly wouldn't work though because myDoc.selection is looking for an array of objects. However, I can't figure out how to loop through all the objects in the document and check to see if they contain the SpotColor.
I want to use the Select > Same > Stroke Color , but I heard that using that in Javascript isn't available unless you have CS6 (which I currently don't). Is it true that accessing menu items through scripting is a feature in CS6?
I'm trying to hide all items in a document (and store each items original visibility state), iterate user pre-selected items and perform an export for each item in selection (I've got this part covered), and finally restore the visibility state of each item again (here's where the storing of original visibility state is needed).
I've found that I can iterate all items in the document using app.activeDocument.pageItems[i] where i is the page item identified by the i-th index in the pageItems collection.
What is not clear, however, is how to get the visibility state of this page item. Indeed, there is a property visbilityVariable associated with page items, but when I try to "inspect" its content using an alert message, I get "undefined".
Are there better ways to iterate all items in a document? Ideally, I'd like to access all items regardless of wether they're path items, group items, text frame items or what have you. I need this collection to read/write the visibility state of each individual item.
I'm on Illy CS2, windows xp.
I want to open a doc, run a script that selects all paths of a color, say 255,0,0 or 50,0,20,4 and changes that color to black or another color I specify and also changes the stroke. Is this possible? I can't see how i would do it?
Is it possible to find out how bright is an color? I need to find the darkest color in document's swatches. My solution would be to convert (script internally, without actually making any changes in document) swatches to grayscale, compare them and pick the darkest. But how to convert swatch defined in undefined mode (they might be in lab or cmyk) to grayscale?
I found in 'js scriping reference' a method "convertSampleColor", but I have no idea how to use it. Any examples?
how would I go about to check if a textframe with specific content exists in a document and if it does then procede with a function?
if ("word" exists) { make a new layer}
I just need it to check if one instance of the word exist
If i want select objects that same fill color in document, I can use 'select - same - Fill color' function in Illustrator.
It's so fast. below 1 second.
But, If i want make it in Javascript, I can't do it like fast.
for(i=0; i<activeDocument.pathItems.length; i++){...}
If document have 10,000 objects, above script can't finish in even 60 seconds.
How Illustrator can traversal fast?
Is there something other way?
changing the file path for links in an Illustrator document?
For example, let's say my Illustrator document is stored at: /Volumes/Storage/Projects/Client/AAA001/designs/concept1.ai
and I have placed 2 linked visuals:
/Volumes/Storage/Projects/Client/AAA001/visuals/big_retouch.psd
/Volumes/Storage/Projects/Client/AAA001/visuals/flattened.jpg
When I open the .AI I noticed that the reference to the visuals is under a %DocumentFiles section:
%%DocumentFiles:/Volumes/Storage/Projects/Client/AAA001/visuals/retouc hed.psd
%%+/Volumes/Storage/Projects/Client/AAA001/visuals/flattened.jpg
I need to replace "/Volumes/Storage/Projects" with "/Volumes/Projects". (There are some more complex replacements I need, but let's start here.)
We need a script that select all pattern objects in the active document in illustrator.
View 5 Replies View RelatedIs there any chance to assign values to an artboard?
I've experimented with “tags”, but they only work for pageItems. (if the item which includes the stored data is deleted, the data is also deleted)
It is simple data like v1=true, v2=false, … I want to assign. And it needs to be saved within the illustrator document.