Illustrator Scripting :: Getting Error 1302 - No Such Element Line
Oct 5, 2012
I am getting an error with a script i have used before without any problems.The script updates the only image at the bottom of a single page PDF and saves the changed PDF in another folder.
It asks me to locate the folder of PDFs to be modified.It asks me to locate the folder where the modified PDFs will be saved.It asks me to select the new image that will be used.It will then update the image and resizes it and save the PDF in the specified folder.
I don't get this error on all PDFs but i get it at least once every 10 PDFs (and there are over a 1,000 PDFs).The error i get is this:
Error 1302:No such elementLine:27-> rip=doc.rasterItems[0].position;
I get this error regardless of whether the script is run in CS3 or CS5.
Additional info.I ran this script in CS3 and it worked. At a later date i ran another script on the folder of modified PDFs in CS5 that deleted any unnessesary elements outside the artboard, it selected All on the Artboard - then inversed the selection - and deleted any selected items followed by save and close.I have tried making sure the "new" image has the same name as the image being replaced but this made no difference.I am using Illustrator on Vista.
The script is below:
#target illustrator
function replaceImage() {
[code]....
View 4 Replies
ADVERTISEMENT
Jul 11, 2012
I'm trying to use indexOf to see whether an element exists within an array. However, when I try to execute my script, it comes back saying "myLayers.indexOf() is not a function"
Here is some of my code:
for (var i = 0; i < myDoc.layers.length; i++) {
if (myLayers.indexOf(myDoc.layers[i]) != -1) {
myDoc.layers[i].remove();
}
}
View 4 Replies
View Related
Oct 9, 2012
I need to do a form of automation, but wanting to execute this from another process (self-made application). Adobe Photoshop has this mechanism called "Droplets" that are executable based upon Actions defined in Photoshop (as far as I can understand). Is it possible to let AI do some work for you from an external application as with Photoshop (assuming you are able to execute the executable once it has been created)?
View 4 Replies
View Related
Apr 1, 2012
how to provide space and new line to the text in AI Script
View 1 Replies
View Related
Jun 6, 2012
I am trying to create a script who could act as an Autocad plot (ie convert each color to black, with a different line weight).
Here is the first script I melted, who create my Black swatch
if ( app.documents.length > 0 ) {
var myDoc = app.activeDocument;
//add Black swatch
var newSwatch = app.activeDocument.swatches.add()
var newColor = new GrayColor();
newColor.gray = 100;
[Code] .........
And here is the second one, who replace one color by Black (it don't change the text, nor the lineweight yet…
if ( app.documents.length > 0 ) {
//test de dialogue
function csDialog() {
var fabGroup = app.activeDocument.swatchGroups.getByName('Fabrics');
var allFabs = fabGroup.getAllSwatches();
var fabNames = Array();
[Code] ........
View 2 Replies
View Related
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
Jun 4, 2012
how to give line height to text in AI Script
View 3 Replies
View Related
Apr 2, 2012
areaText.contents = "This is an Area Text in a rectangle. See how it flows to the next line.";
/*
i want to break the sentance from 'Text' ie i want to add new line in between and also some more spaces.
*/
For example: I want to write the above text like this way
this is an Area. Text in a rectangle. See how it flows to the next line.
View 2 Replies
View Related
Oct 14, 2013
I want that form recognize new line character. (like ')So I programmed like this. But it's not working.
var win =new Window ("dialog", "test");win.orientation = "column";
var form1 = win.add ("edittext", undefined, "");form1.onChanging = function(){ if(form1.text.search("
") == true){ form2.active = true; }}
var form2 = win.add ("edittext", undefined, "");
var form3 = win.add ("edittext", undefined, "");
wzn.show();
How can i make it auto line alignment in ScriptUI?
View 6 Replies
View Related
Apr 5, 2013
I have about 500 files that I need to change one line of text in. Example. File name is XXX 001, the line of text is the file name so it would read XXX 001. XXX 002... etc. up to XXX 500. Is there a way that I could automate it opening, changing this line of text, saving and closing?
View 1 Replies
View Related
Mar 5, 2012
Is it possible to block this message with javascript?
I've already tried the following:
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
This won't work.
View 3 Replies
View Related
Mar 21, 2014
I am creating a script on illustrator CS6 that will loop through all the images and relink these images to there current location, it is used to update all of the links in the file. However sometimes when i run this script i will get the error 376('x ') i have searched for the meaning of this and cannot find it anywhere. It is being written in extendscript, the code i am using is shown below:
// execute the main function
main();
// Construct the main function
function main() {
var retVal = "OK";
[code]....
View 2 Replies
View Related
Aug 10, 2012
I'm working on a javascript that goes through a folder, rasterizes the paths inside each file, and saves the results as separate files in another folder. My script works fine on individual files as well as for several simple files. However, once it gets going on some of the big ones, it starts to give me PARM errors.
Illustrator CS5.1Windows XP, SP3 (work computer)JavascriptThe CAD export that created the pdf and eps files broke any curves into tons of tiny straight lines. As a result, these drawings can have 15-35 thousand paths per image.
Get the source and destination directoriesOpen a file from the source directoryGo to the first layer of the fileLoop through all text items to move them to their own layerLoop through all path and compound paths to move them to a groupRasterize the group of path itemsRepeat for the next layer and so onSave the file to the destination directoryRepeat the process for the next file and so on.The scripting guide suggests it could be from conflicting functions or global variables overwriting each other. However, my script is now entirely contained within its own function, and all variables are declared locally. Running from a clean illustrator and ESTK startup, it will still produce a PARM error after a few large files.
The guide also suggests having the script quit and re-launch Illustrator after working on many files. Since I assume these huge diagrams are probably several "normal" files' worth of objects each, I figured it probably just needs to restart Illustrator after x amount of stuff goes through. So I look in the guide's section on launching Illustrator through javascript. That basically says "Why would you ever need to do that?" I tried looking it up in the tools guide, but that document isn't very clear at all.
1. What would I have to do so Illustrator doesn't throw a PARM error on the line marked below? (besides just putting it in a try/catch and pretending it didn't happen) It doesn't consistently happen on the same file or even at the same point in the file, but always at that line.
This is just a tiny part of the script. objectClass is a placeholder for PathItems, CompoundPathItems, etc. Looping backwards and setting the group to null at the end were just experiments, neither of which had any effect on the error.
if(objectClass.length > 0){
var objectGroup = myLayer.groupItems.add();
for(var i = objectClass.length; i > 0; i--){
objectClass[i-1].move(objectGroup, ElementPlacement.PLACEATBEGINNING); //This one keeps breaking stuff.
}
sourceDoc.rasterize(objectGroup, rastBounds, rastOptions);
objectGroup = null;
}
2. Failing that, how can I relaunch Illustrator through javascript? Or a limited amount of VBScript, though my knowledge of that is limited too.
View 16 Replies
View Related
Jul 24, 2013
I have written a simple script to to trace a raster image using Illustrator.The image can be traced using >Object > Image trace in Illustrator without any problems.However, when I run my script I get the following error: Application error 12321(some long number) 'MARC'.
var jpgFilePath = new File ("/Users/Ellipse8.jpg"
createRasterItem(jpgFilePath)
function createRasterItem(jpgFilePath) {
var rasterFile = File(jpgFilePath);
var myDoc = app.documents.add();
[code]....
View 2 Replies
View Related
Aug 12, 2013
I try to open mulitple ai files through palette dialog but it fails on Error:8702, there is no document. But if i change to var win = new Window ("dialog", "Batch"); the open file works well.
var txtSourceFolder = win.add("edittext",undefined);
var btnOk = win.add("button",undefined,"Run");
btnOk.onClick=function(){
try
[Code] ....
View 2 Replies
View Related
Apr 7, 2013
i gotta problem wit 'Element 3D v1.6'window version. when im animated E3D and then trynna 'Ram preview' in that case.i gotta error message like below,'element has encountered an unrecoverable error' 'after effect warning: a frame failed to render while using render multiple frames simultaneously. allocating more memory to the background processes in Memory & Multiprocessing preferences may fix this problem.'
but im did it everythin in M&M preference and this error only Rampreviewing wit E3D, anything is cool. My issue is Few days ago Upgrade VGA card n Driver and Element3D v1.6 update.
View 4 Replies
View Related
Jun 27, 2011
I have an error that started appearing in my VBA programs since we upgraded to AutoCAD 2012. This problem never occured in our previous releases. The program is supposed to loop through all entities in paperspace and check for entities that are a acBlockReference object.
Below is a simplified version of my program. I get an Element Not Found error on the line noted. Again, this has never happened in any of our previous versions of AutoCAD. Just started with 2012.
Sub Test
Dim blkref As AcadBlockReference
Dim entry As Variant
For Each entry In ThisDrawing.PaperSpace
If entry.EntityType = acBlockReference Then ' <-This is where the Element Not Found error occurs
msgbox entry.name
endif
next
end sub
View 1 Replies
View Related
Jul 21, 2012
Why can't I rename a shader? I am following a Gnomon eye tutorial and when I rename a blinn, lambert or any other shader/material this pops up Error: Could not find UI element named "". After the error I can't access the hardware texture rollout on the shader. Its happened with all maya versions since 2009 with different PC's, the graphics cards I have used are gaming cards both nvidia/ati at the moment its a 460gtx could that be the problem, do I need a Quadro card.
View 2 Replies
View Related
Apr 17, 2012
error: Can't obtain permission to edit the element: The Central Model is inaccessible. You can check out worksets at risk, but consider carefully!thats what it says i took the file of my the drive but cant edit it.
View 1 Replies
View Related
Sep 19, 2011
we've made a part from an assembly and put the stress analysis to the test. Unfortunately the analysis doesn't complete it's run, because of an error:
"An error occurred while creating the finite element mesh. The cause may be invalid geometry or features that are extremely small in comparison to the overall dimensions of the part. To fix the problem, please suppress those problematic features or use standard meshing method."
We can't change the thickness of the sheet-metal, because it's a model which comes from a supplier with a different cad-program. And supressing any features isn't possible, because it's a base-solid.
But where can we change it to the standard meshing methode? The program is recently re-installed on my computer, the settings haven't changed since it's been installed. We can't find the feature.
View 2 Replies
View Related
Dec 18, 2012
I'm try to automate the importing of the Varaible and datasets into my graphs via Scripting, but the ImportVaraibles() function doesn't seem to work. Here is my Script, mostly copied from the example script provided with Illustrator (CS5). And, this works manually, using the file names in the script, via Load Variable Library
Set appRef = CreateObject(strIllistratorVersion)
'Open the file and import the datasets
Set docRef = appRef.Open(strTemplate & "200-500.ai")
'docRef.Datasets.RemoveAll
docRef.Variables("Yearbook").Delete
Here is the problem, after I delete the previous library, then this next line, right from the example, does nothing
The script then exits with 'No Datasets in this document'
docRef.ImportVariables (strXMLFolder & "Lumber_200-500.xml")
'appRef.DoJavaScript "alert('Template:" & strTemplate & strRange & ".ai | XML file:" & strXMLFolder & "" & objFile.Name & "^')"
If (appRef.Documents.Count > 0) Then
Set docRef = appRef.Documents(1)
[Code]....
If I remove that delete line, the script runs, but just uses whatever Variables I had last loaded, not the XML file.
It's simply not loading. What do I need to do to get it to load?
View 8 Replies
View Related
May 6, 2012
Can you access graph data through the scripting DOM?
View 3 Replies
View Related
Mar 17, 2010
how you could select only one element from within an AI document and be able to export just that element out. For example, I'm making a letterhead and I want to select just a logo element from my page and export just that to an eps so that it could be imported into something else.
Back when I was using Corel Draw I could simply select anything and as long as it was the only thing selected I could export it to a new eps file, or whatever kind of file I wanted. If I did it with an image, the image would be cropped to just the bounds of the image.
So far it seems the only way to do this in AI is to export the entire artboard. I'm sure this can't be because that would be ludicrous, right?
View 11 Replies
View Related
Nov 2, 2012
I followed this tutorial to create 3D Christmas lights, and all was going well until I reached one of the final steps- release clipping mask in order to proceed with making a pattern brush. The "Release" option is simply not available, I'm only allowed to "Make."
My questions:
- What might have I missed/what should I look for to enable making a pattern brush with 3d objects?
View 4 Replies
View Related
Mar 28, 2013
Copying an element which has a graphic style applied now breaks apart the style into individual elements if the style is applied to text, the text is outlined too. This never use to happen. Have tried changing the paste board setting but this changes nothing.
View 8 Replies
View Related
Mar 22, 2013
I have text with two strokes apllied to it. I want to cut/delete the first stroke to have the apperance of a stroke that has a gap between the text fill and the stroke. Or if there is an easier way to have the outline apllied, expanded (for lack of a better term) off of the fill?
View 3 Replies
View Related
Aug 28, 2013
When i import a DXF file into Illustrator created in AutoCAD, i have the problem that the positions of the elements (rectangles, circles etc.) are not on the exact position as created in AutoCAD. The variations are very minor (Centerposiotion of a element x 5mm y 5mm in AutoCad = x 4.969 y 4.949 after import in Illustrator). Sometimes the sizes of the elements variate also slightly (a line which is 102mm in AutoCAD is 101.99mm after import in Illustrator) but not generally.
I tried various files with different export versions from AutoCAD, including different measures such as mm to inch and points and so on. I tried also the different importing options in Illustrator. The closest i come is Centerposiotion of a element x 5mm y 5mm in AutoCad = x 4.969 y 4.949 but never exact. How to get a DXF file into illustrator by keeping every element in place and size?
View 2 Replies
View Related
Mar 16, 2013
the Script of creating mirror text and stroke text in Adobe illustrator scripting.
View 4 Replies
View Related
Mar 24, 2014
I should be able to apply an effect to a line that has been made with the line tool. Why is this not working?I thought that maybe I might have disabled Effects somehow, but I can't think of anything.
View 9 Replies
View Related
Jun 25, 2012
I am using live paint to paint cartoon character illustrations. The artwork is brought into Illustrator CS3 and live traced. Then I convert it to a live paint group and use the paint bucket to fill. Everything looks fine no matter how much I zoom in. If I bring the AI file into Photoshop CS6 I can see a thin white line between the black line art and the fill. This is most noticeable where black meets black. I can also see this sometimes in file previews while browsing through files. If the white line cannot be seen in Illustrator is the file ok? I did just upgrade to CS6 if that would make a difference.
View 2 Replies
View Related
Oct 18, 2012
I must have pushed one or the other button but I don't know which one!
I use CS5 and have now a small arrow on my line segment tool (as shown in the picutres):
Ever since that when i click shift, it just allows me to draw vertical lines, rather than vertical or horizontal.
View 1 Replies
View Related