An action that deletes all hidden objects

Hello
In a constant effort to save and place smaller files...I was wondering if there was a way to script illustrator files so that it deletes all the hidden objects.
I end up with so many hiden objects in these files, I am sure that would be a great help, if I could set an action either inside of illustrator or through a script to drag and drop files onto to that would delete the hidden files.
I cannot find any commands on this in the program, so I did not know if it is possible, but I figures I would try.
thanks!
babs

Here's a script that I have to delete hidden layers in a file. It could be reworked to target page items. Remember you can only delete something if it is visible.
--get a sourceFolder that holds the files to process
set sourceFolder to (choose folder with prompt "Choose a folder with files to process:") as text
-- get a list of files of the files to process in the sourceFolder
tell application "Finder" to set workingFiles to (every file of folder sourceFolder) as alias list
repeat with aFile in workingFiles
    tell application "Adobe Illustrator"
        open aFile
        set currentFile to front document
        tell application "Adobe Illustrator"
            set myLayers to every layer of currentFile
            repeat with i from 1 to count of items in myLayers
                set myLayer to item i of myLayers
                set locked of myLayer to false
                if visible of myLayer is true then
                    set visible of myLayer to false
                else if visible of myLayer is false then
                    set visible of myLayer to true
                end if
            end repeat
            delete (every layer of currentFile whose visible is true)
        end tell
        tell application "Adobe Illustrator"
            set visible of (every layer of currentFile) to true
        end tell
        close currentFile with saving
    end tell
end repeat

Similar Messages

  • Delete all the objects in a package

    Hi Guys,
    My requirement is that i need to write a program to delete all the objects in a package. In the selection screen i enter the package name and then i get all the objects in the package from TADIR table and display them in an ALV.
    There when i select a object and press the delete button ,the object (program ,table, domain,data element etc..) should be deleted .
    For this i tried to DEBUG in SE80 and tried to know how SAP is trying to delete the object. But i couldnot unterstand which Function Module or which Class and Method it uses to delete an object.
    Guys please let me know how it can be done.
    Regards,
    Chaithanya.

    hi
    check this ...
    REPORT  zxxxxxx.
    TYPE-POOLS: slis.
    DATA: x_fieldcat  TYPE lvc_s_fcat,
          it_fieldcat TYPE lvc_t_fcat,
          g_grid    TYPE REF TO cl_gui_alv_grid,
          x_layout TYPE lvc_s_layo,
           g_custom_container type ref to cl_gui_custom_container,
            g_container type scrfname value 'I_CONTAINER'.
    types: BEGIN OF ty_itab ,
            check(1) TYPE c,
           PGMID LIKE TADIR-PGMID,
                 END OF ty_itab,
    data:itab type standard table of ty_itab,
           itab1 type TADIR.
      call screen 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    module STATUS_0100 output.
      SET PF-STATUS 'ZSTATUS100'.
      if g_custom_container is initial.
        create object g_custom_container
               exporting container_name = g_container.
        create object g_grid
               exporting i_parent = g_custom_container.
    SELECT PGMID
      FROM TADIR
       INTO CORRESPONDING FIELDS OF TABLE itab where DEVCLASS = selection screen package
    x_fieldcat-fieldname = 'CHECK'.
    x_fieldcat-seltext = 'CHECK'.
    x_fieldcat-checkbox = 'X'.
    x_fieldcat-edit = 'X'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 1.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'PGMIDt'.
    x_fieldcat-seltext = 'PGMIDt'.
    *x_fieldcat-edit = 'X'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 2.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    CALL METHOD g_grid->set_table_for_first_display
      EXPORTING
        IS_LAYOUT                     = x_layout
      CHANGING
        it_outtab                     = itab
        IT_FIELDCATALOG               = it_fieldcat.
    endif.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    module USER_COMMAND_0100 input.
    DATA: ls_outtab LIKE LINE OF itab.
    DATA: l_valid TYPE c,
          ok_code like sy-ucomm,
           r_ucomm LIKE sy-ucomm,
           ls_celltab TYPE lvc_s_styl,
          lt_celltab TYPE lvc_t_styl,
          l_index TYPE i.
    CALL METHOD g_grid->check_changed_data
      IMPORTING
        e_valid = l_valid.
    IF l_valid EQ 'X'.
    case sy-ucomm.
    when 'DELETE'.
    LOOP AT itab INTO ls_outtab where check = 'X'.
       move ls_outtab-object to itab1.
      delete TADIR from itab1.
    ENDLOOP.
    endcase.

  • HOW TO DELETE ALL INFO OBJECTS IN A SYSTEM

    HI! gurus,
    I want to know how to delete all user created info objects in my laptop.the situation is while practicing SAP in my laptop ...creation of user info objects occured heavily resulting in degrading the system performance.so is there any procedure to delete all info objects(user created)making a system a newly SAP installed one....please help me....
    Regards
    Ravikanth Pinipolu

    Hi Ravi,
    u can try it manually to delete the User defined objects..
    or u can use the prg: RSDG_IOBJ_DELETE and in that u can give some selection of objects for the deletion..
    Give it a try..
    Thanks
    Hope this helps

  • I'm setting up my new iPhone and already have an iTunes account.  It's asking me if I would like to set up as a new iPhone, or Restore from the backup of my iTouch.  If i set up as a new iPhone will that delete all my music from my previous iTunes account

    I'm setting up my new iPhone and already have an iTunes account.  It's asking me if I would like to set up as a new iPhone, or Restore from the backup of my iTouch.  If i set up as a new iPhone will that delete all my music from my previous iTunes account?

    It will not do anything at all to your computer.

  • I have to erase and syne my iPhone 4s will that delete all my contacts?

    So apparently my iPhone syne to another computer. To sync it with the one I use I have to erase and sync. Will that delete all my contacts???

    You might if you select to sync contacts on the Info tab of your iTunes sync settings and sync to an empty contact application on your computer (e.g., Outlook or Windows Contacts).  As a safety precaution download the free app My Contacts Backup.  This will back up your contacts as an attachment to an email which you send to yourself.  If necessary, you can later open this email on your phone and tap the attachment to re-import your contacts to your phone.  After doing this, follow this guide to preserve your other data and settings: https://discussions.apple.com/docs/DOC-3141.  If you aren't syncing your calendar or contacts with your computer, you can skip step 2; just be sure to deselect syncing calendars and contacts on the Info tap of your iTune sync settings prior to syncing.

  • How do you disable the shortcut key in Mail that deletes all mail in the trash folder

    Is there a way to disable the shortcut key in Mail in Mountain Lion that deletes all mail in the Trash folder in all accounts: <shift><command><delete> ?
    I did it once by mistake and it deleted all my trash - it is very difficult to restore when there are thousands of messages in various emaiil accounts.
    Thanks

    While you can't (so far as I know) remove it - you can assign a different (& less likely to be used accidentally) one via System Preferences - Keyboard - Shortcuts.
    Go there, create a new one (or 2) for Mail only, and give it the exact name(s) if the menu item(s) in question, capitalisation & ... included.
    Below is on 10.6, but the idea's the same

  • Script that deletes all the data in the DB

    Somebody has or know a script that delete all the data (but not the tables) of the database???? I have dummy data and know I need the tables clean of data.
    How can I delete it???????? Thank you for you help
    Javier

    You could truncate all the tables with the following commandTRUNCATE TABLE <table_name>;This will delete all the data in the table while keeping the table structure, contraints, indexes, triggers, etc. intact so they wont have to be rebuilt. All foreign keys must be disabled to use the TRUNCATE command.

  • HT4859 if i didn't activate iCloud to my "notes," once i plug my phone into my computer does that delete all of my notes and there's no way to access them again?

    if i didn't activate iCloud to my "notes," once i plug my phone into my computer does that delete all of my notes and there's no way to access them again?

    The first thing to try is to make sure you are not in Full Screen Mode. Press F11.

  • Is there a script or action to delete all the alpha/channels?

    Hi
    when i work on an image , i create lots of alpha channels , is there a script/action to delete all with 1 click?
    i run ps cs6 64bit , windows7 64 bit
    i found a short script but it's amazing slow
    thanks

    Thanks Kelly
    i miss you one thing delete all 4 color samples
    i use notepad++ and synwrite
    something like delete color samples can be done with the plugin
    to delete color samples i use this
    #target photoshop
    app.bringToFront();
    var theImage = app.activeDocument;
    // flatten the layers
    // theImage.flatten();
    // delete alphas
    // theImage.channels.removeAll();
    // delete paths
    // theImage.pathItems.removeAll();
    // delete layercomps
    // theImage.layerComps.removeAll();
    // delete color samplers
    theImage.colorSamplers.removeAll();
    // clear guides

  • Create Action that delete input file after OCR

    I've created an Acrobat X Pro action that OCR's all files in a given INPUT directory and then save the OCR file in an OUTPUT directory.  Is there a way to delete the file from the INPUT directory once it's processed?

    Hi,
    There is a way but I would not do it. Rather than put the files to an "output" folder you can replace the original files in the "input" folder. Why not delete the original files through windows when the process is complete?

  • Delete all inactive objects in a Transport Request

    Hi,
    I want to delete all the inactive objects in a transport Request . How can i do this ? I have many inactive objects in a request so i want to delete them first and then transport it . How can i do this . Please help..

    Hi,
      go to transaction se10 click on display individually enter teh request and click display and then you would get the list of all objects in that request so you can check which one are inactive and delete.
    Or you can also go to se80 in the repository browser you can choose inactive objects so it would show all inactive objects for a user from there also you can delete objects.
    Regards,
    Himanshu

  • NEW COMPLETE BACK UP THAT DELETED ALL PREVIOUS BACK UPS

    I have a 1TB Time Capsule that I bought in October 2008. I have been using it with Time Machine for back ups. Earlier this week Time Machine gave me a message that it wanted to do a new complete back up that would delete my previous back ups. I thought this was weird, but it said it would improve reliability. It would not do any back ups until I agreed. I didn't want to start it at that time because I wanted to update to Mountain Lion before getting rid of any back ups. Too late! I have updated to Mountain Lion and gotten all the updates released this week, meanwhile the back up started and delete nearly 4 years worth of back ups! Has this happened to anyone else?

    I'm having the same issue, but my TC is only 4 months old. I'm glad I have a separate external hard drive that will do backups, but it was supposed to alternate between the TC and external drive.
    Everything was working fine until upgrading to ML....
    This is a screenshot that I just took and the Data (TC) drive has been sitting like this since last night when it wanted to do a brand new backup and delete all previous ones. Left the computer on all night because it said that the backup would take approximately 17 hours. Geez...
    Message was edited by: calston5

  • How to delete all users (objects) in 9i database?

    Hi friends:
    I did a full database exp/imp for a dev database, before imp, I need to delete all objects in the old dev database, I know delete one user is
    drop user user_name cascade;
    how about all users (objects)???? in 9i database
    thank you very much

    Hi,
    I will use
    select ' drop user ' ||username|| ' cascade;' from all_users where username not
    in ('SYS','SYSTEM', ‘DBSNMP’);
    Is there any other users I don't need to drop off besides the above three ones?
    thank you very much

  • How can I delete all "hidden" contacts in iCloud?

    Here's my problem. iCloud stores old contacts, maybe ones I emailed once or twice. I heard of this issue months ago, and to remedy, all I could do was reset my phone and keep iCloud shut off so that it didn't store these old contacts.
    Anyway, when I moved to ios7, I forgot this, and turned on iCloud as I got set up. I put my Gmail account in as normal. When I went to compose an email and typed in a couple letters of the person I was intending to write (from my Gmail contacts) I saw them, as well as a host of other old emails and knew it was iCloud. I confirmed this when I went into iCloud Web, which that email acct. I never used and is ermpty, and typed in the contacts in a compose message and voila, all these names appeared.
    For my phone, I had to reset it again and make sure to keep iCloud off so I don't see those contacts, but this is a big issue - Apple is storing these old contacts that I want obliterated. There are personal reasons I deleted those contacts, and in the case of iCloud, it imported an address book from an old employer and none of those folks I ever want to see again.
    Same for texting on the phone, I've noticed that if you delete a contact, they still live in the phone. I don't understand why we can't obliterate these. I don't get why Apple is insistent on us keeping these old contacts in our lives...

    Have you already tried to delete the contacts with the following steps:
    1. sign in at www.cloud.com
    2. open "Contacts"
    3. click on the little "Settings" cog wheel icon in the lower left hand corner
    4. choose "select all"
    5. and then choose "delete"

  • Creating an action that treats all files in a directory

    How can I make an action which changes the picture size and resolution for all files in a directory and saves the new versions of the files in a subdirectory?
    Thanks

    Macro Details wrote:
    First create your Sub directory. Then start the Action. Open file, Resisize save as (to Sub directory) then close the file.
    Now: File- Automate-Batch. Select your action and your folders and overide the open Command and the Save As Command.
    Frankly Norbert I think the Image processor way is easier but to each his own as they say.  

Maybe you are looking for

  • What the heck is going on with the S3 Jelly Bean update

    While I do think it is ridiculous that we don't have JB for the S3 yet, I think I'd rather have them fix the f'n radio reception problems on the S3.   Not sure the Verizon has so many issues with the S3 when it is one of the best selling phones for a

  • Layout is not proper when viewed through repeat output option

    hi when i issue output and see the print prevew every thing is comming properly in the layout. but when i click on button Repeat output and if i issue the output again some of the data is missing in the layout can any one tell me what can be the reas

  • Getting Error Logs Every Minit's From 5k

    Hi, Am getting every minit's this below logs......... Can i know why it's happening.... Please advice me.... Logs: ===== 2012 Sep  3 17:17:42 5k %ETHPORT-5-IF_UP: Interface Ethernet106/1/3 is up in mode access 2012 Sep  3 17:17:55 5k %ETHPORT-5-IF_DO

  • Image size vs file size

    Hello, I would very much appreciate an answer to the follwing:  When I save a file to jpeg the image size in photoshop remains the same as it was as a tiff file BUT according to the information that comes up in windows properties the file is much sma

  • Windows 7 installation went wrong - lost Mac OS X?

    Hello, PLEASE BE PATIENT AND READ WHOLE TEXT. I went through the windows 7 installation process and i installed windows but unfortunately i can't find my mac os x anymore! When i restart and press option key button black screen appears that lasts for