[AS] Can't Delete a Page Item


i'm stumped how delete page item. it's embedded jpeg in ai doc. basically, can delete selecting , running simple script this:

 

 

tell application "adobe illustrator"

     tell current document

          delete selection

     end tell

end tell

 

however, if try find , delete part of larger script, won't delete. no error thrown , else in script works, item not deleted. here's chunk of script hoped find , delete item. note script can find item fine because i'm able copy position property , use position item i'm pasting in.

 

set thelist every page item of document 1

     repeat e 1 count of thelist

          set theobject item e of thelist

               if width of theobject = 26 then

                    set thebounds position of theobject

                    delete theobject

                    paste

                    set paster item 1 of selection

                    set position of paster thebounds

               end if

     end repeat

any ideas great help. thanks.

you might have more luck looking raster items running through page items if want delete embedded jpeg.

this example

 

tell application "adobe illustrator"
    set docref current document
    set rasters (every page item of docref) class raster item
    delete rasters
    close docref saving yes
end tell



More discussions in Illustrator Scripting


adobe

Comments

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support