Trying to delete everything without a stoke or fill

var doc = app.activeDocument;
for(var i=doc.pathItems.length-1; i>-1; i--){
if(pathItem.filled==false && pathItem.stroked==false)    //I think this is where the error is
  alert("Found "+pathItem);
  doc.pathItems[i].remove()
So I am trying to find everything that does not have a stoke or fill and then delete it. I used this as a reference Finding pathItems that have no fill and no stroke Not sure what I did wrong I am new to javascript. Any help would be great I've been at this all day and it is very frustrating lol. I have CS6.

Hi djbgraphicdesign,
in your example pathItem is not defined. Please use doc.pathItems[counter] instead.
var doc = app.activeDocument;
for(i = doc.pathItems.length-1; i >= 0; i--){
if(doc.pathItems[i].filled == false && doc.pathItems[i].stroked == false)
  alert("Found " + doc.pathItems[i] + " i");
  doc.pathItems[i].remove();
This should do the job.
(You can also use a variable for doc.pathItems and use this variable instead.)
Have fun

Similar Messages

Maybe you are looking for

  • How to get the output in the required format

    Hi, I have a table Months it has 2 columns month_id (number) and month_name(varchar2). I wish to get the o/p from a select query such that , when user chooses a specific month_id it should appear first and rest all months should come below it in asce

  • Can´t import bought  Itunes songs to my libary

    Hi, after moving my songs to an external drive an update the libary, itunes do not import some songs I buyed in the Itunes store. Got no idea. The account is activated. Regards, Art

  • PS6b1: "The GPU Sniffer Crashed" Win7 X64

    PS CS6B1 reports "Photoshop detected an error in your display drive" and disables GPU settings when running on Win7 x64 system with Asus EAH 6970 (AMD Radeon 6970) graphics card.  I verfied that the latest Asus/AMD drivers are installed and working p

  • Problem to assign BP in organization model

    Hi sap I have configured the service desk in solution manager. I create my organization model from transaction ppoma_crm. Now I think that I must assign business partner to organization units (first level support, second level support ..) but I can't

  • Is the trial version of Illustrator full-featured?

    Does the trial support file import/export and cutting & printing, or is it limited in any way other than the 30-days? Thanks, Jim