How do I delete all empty graphics frames from a document?

I have data merged a document and need to remove all the empty graphics frames as quick as possible.
I have found solutions for deleting empty text frames but not graphics frames. Can somebody help with this as it will save soo much time and RSI!
I found an applescript solution here:
http://forums.adobe.com/thread/756281
However, I am running Windows 7 and Id CC
Cheers,
Kris.

Hi MToys
I added a little to the script so that it will work on Ovals and Polygons also. [Not TextFrames]
You just have to set the values for which of the frame types you want to delete.
You can do this by setting the const values at the top of the script for DeleteRectangle, DeleteOvals, DeletePolygons
There are a few uncertainties that I had:
If an object is selected, should the script only delete that objects frame type.
I.e., If you select an oval, should the script know to delete only ovals.
At this point, I did not do that, rather it will just get the settings from the selected object, and delete all frame types with those settings
I had to disable matching the transparency settings because they werent comparing correctly between different frame types
Meaning, I made 3 frames, Oval, Rectangle and Polygon - no settings applied.
I selected the oval and ran the script. It only deleted the oval even though set it to delete all.
I found that the transparency settings werent matching... even though there werent any
So, for now - its disabled.
If someone can shed some light on this I would appreciate it.
I tested the script on Mac Mountain Lion - ID CS6 and seems to work well
Here is the script
const Object_Style = false,
    Fill_Color = true,
    Fill_Tint = true,
    Fill_Transparency_Settings = true,
    Item_Layer = true,
    Stroke_Color = true,
    Stroke_Weight = true,
    Stroke_Type = true,
    Stroke_Transparency_Settings = true,
    Stroke_Tint = true,
    Stroke_Alignment = true;
const DeleteRectangles = true,
    DeleteOvals = true,
    DeletePolygons = true;
app.doScript(main, undefined , undefined, UndoModes.fastEntireScript, "INSERT_HERE_THE_SCRIPT_NAME")
function main() {
    var myDoc = app.activeDocument;
    var mySel = app.selection;
    if (mySel.length > 0) {
        mySample = app.selection[0];
        if (mySample.constructor.name == "Rectangle" ||
            mySample.constructor.name == "Oval" ||
            mySample.constructor.name == "Polygon")
            var isSample = true;
            var objSty, fClr, fTint, fTrans, lay, sClr, sWeight, sType, sTrans, sTint, sAlign;
            GetProps(mySample);
    if (DeleteRectangles) {DeleteItems(myDoc.rectangles)}
    if (DeleteOvals) {DeleteItems(myDoc.ovals)}
    if (DeletePolygons) {DeleteItems(myDoc.polygons)}
    function DeleteItems(myGraphicFrames) {
        for (var i = myGraphicFrames.length-1; i >= 0; i--) {
            if (myGraphicFrames[i].graphics.length < 1) {
                myGraphicFrames[i].select();
                if (isSample) if (!checkProps(myGraphicFrames[i])) continue;
                myGraphicFrames[i].remove();
    // ======================================
    function GetProps(mySample) {
        objSty = mySample.appliedObjectStyle;
        fClr = mySample.fillColor;
        fTint = mySample.fillTint;
        fTrans = mySample.fillTransparencySettings;
        lay = mySample.itemLayer.name;
        sClr = mySample.strokeColor;
        sWeight = mySample.strokeWeight;
        sType = mySample.strokeType;
        sTrans = mySample.strokeTransparencySettings;
        sTint = mySample.strokeTint;
        sAlign = mySample.strokeAlignment;   
    // ======================================
    function checkProps(myFrame) {
        var i=0;
        if (Object_Style) if (myFrame.appliedObjectStyle != objSty) return false;
        if (Fill_Color) if (myFrame.fillColor != fClr) return false;
        if (Fill_Tint) if (myFrame.fillTint != fTint) return false;
        if (Item_Layer) if (myFrame.itemLayer.name != lay) return false;
        if (Stroke_Color) if (myFrame.strokeColor != sClr) return false;
        if (Stroke_Weight) if (myFrame.strokeWeight != sWeight) return false;
        if (Stroke_Type) if (myFrame.strokeType != sType) return false;
        if (Stroke_Tint) if (myFrame.strokeTint != sTint) return false;
        if (Stroke_Alignment) if (myFrame.strokeAlignment != sAlign) return false;
        //if (Stroke_Transparency_Settings) if (myFrame.strokeTransparencySettings != sTrans) return false;
        //if (Fill_Transparency_Settings) if (myFrame.fillTransparencySettings != fTrans) return false;
        return true;

Similar Messages

  • How can I delete all of my contacts from my iphone? I have updated my contact list in Outlook, and need to re-import that "clean" list.

    How can I delete all of my contacts from my iphone? I have updated my contact list in Outlook, and need to re-import that "clean" list.

    There is a checkbox on the 'info' tab in iTunes that will allow you to overwrite the address book on the phone with the one from the computer on the next sync.

  • How can I delete ALL photos at once from iPad 1 (OS 5.1.1) ?

    How can I delete ALL photos at once from iPad 1 (OS 5.1.1) ?

    Weird but I can't see "Photos & Camera" in "Settings / / General / usage".
    It's werid because I have pictures on the iPad.
    I'm thinknig to complete delete everything and restore system.
    Any other suggestions ?

  • How do I delete ALL my sent emails from my iPad at once?

    How do I delete ALL my sent emails from my iPad at once? I can do the inbox but not the sent.

    There is no built in way to do this in iOS. If this trick doesn't work for you, then it can't be done.
    http://www.conferencesthatwork.com/index.php/technology/2014/01/how-to-delete-al l-mail-messages-from-iphoneipad-in-one-step/

  • How do i delete all my old music from my old ipod that my exwife go me ? with deleting the itunes i bought?

    how do i delete all my old music that i try transfering from my old ipod to my new itunes account? without deleting my new i tunes i bought?

    i found the answer... iTunes Match

  • How can I delete all songs and data from my 80GB ipod classic without opening itunes?

    I have an older 80GB ipod classic that works but will not play any songs. I'm trying to delete all songs and data from the hard drive to see if that will fix the problem, however, it will not appear in my itunes. I've tried various ways to help it appear in my itunes but I do not want to delete my itunes because I have another ipod that has all those songs on it.
    I was wondering if there was a way to restore my ipod back to the beginning without having to go through itunes. Thanks!

    It might, but I wouldn't bet much on it.  Either way, give it a shot.
    Otherwise, if appears in Windows an external hard disk, try a low level reformat of the device's hard drive.  See here for instructions on how to do this.
    http://www.methodshop.com/gadgets/ipodsupport/erase/
    B-rock

  • How can i delete all photos and videos from iPhone?

    using ios 7 on iphone 5 and want to delete all photos and videos from iphone.
    how can one do this?

    any third party software??
    also is there a way to be sure that all the photos are on my iphoto?
    how can i be sure?

  • How can I delete all emails at once from IPhone?

    I want to be able to delete all of my emails at one time from my IPhone.  I have to mail accounts: Yahoo and Gmail.

    karolanne wrote:
    I want to be able to delete all of my emails at one time from my IPhone.  I have to mail accounts: Yahoo and Gmail.
    http://www.conferencesthatwork.com/index.php/technology/2014/01/how-to-delete-al l-mail-messages-from-iphoneipad-in-one-step/
    >> Open Inbox >> Edit >> Mark All >> Mark As Read
    >> Open Inbox >> Edit  >> Check/select the top message; it will highlight the move button.
    >> Press and hold the move button and uncheck the message that you had checked earlier.
    >> Lift all your fingers off from the ipad screen and leave it alone. Wait until all your messages pile up on the right hand portion of the screen (in ipad); iphone will give you the actual number of emails it has selected for the action. Now they are just waiting for your command to be moved ALL at once.
    >> Choose trash to delete all of them or any other folder where u want to move them, like one piece. Remember this will replicate your action on the server so you will ACTUALLY move them or delete them on the server and not just the ipad.
    Once you have moved all messages to the trash you can either leave them there for the scheduled cleaning or empty it right away by doing this: go to trash folder and touch Edit. The Delete All button shows up at the bottom of the screen. Hit it! You’re done!

  • How can I delete all aol email accounts from my iPad and start over

    What's supposed to happen now?

    What problem are you having?
    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    Using a POP account with multiple devices
    http://support.apple.com/kb/ht3228
    iOS: Adding an email account
    http://support.apple.com/kb/HT4810
    iOS: Setting up an Outlook.com, Hotmail, Live, or MSN email account
    http://support.apple.com/kb/ht1694
    iPhone, iPad, iPod touch: Microsoft Outlook 2003, Outlook 2007, Outlook 2010 may not display contacts and calendars after sync
    http://support.apple.com/kb/TS1944
    Server does not allow relaying email error, fix
    http://appletoolbox.com/2012/01/server-does-not-allow-relaying-email-error-fix/
    Why Does My iPad Say “Cannot Connect to Server”?
    http://www.ehow.co.uk/info_8693415_ipad-say-cannot-connect-server.html
    Gmail Account Will Not Connect to Gmail Server
    http://support.apple.com/kb/ts3058
    How to Delete Email on the iPad
    http://ipad.about.com/od/iPad_Guide/ss/How-To-Delete-Email-On-The-Ipad.htm
    How to Mass Delete Emails from iPhone and iPad Inbox (with video)
    http://suiteminute.com/how-to-mass-delete-emails-from-iphone-and-ipad-inbox/
    How to delete ALL mail messages from iPhone/iPad in one step
    http://www.conferencesthatwork.com/index.php/technology/2014/01/how-to-delete-al l-mail-messages-from-iphoneipad-in-one-step/
    How to add, send and open iPad email attachments
    http://www.iskysoft.com/apple-ipad/ipad-email-attachments.html
    How to Sync Contacts with Your iPad Using iTunes
    http://www.dummies.com/how-to/content/how-to-sync-contacts-with-your-ipad-using- itunes.html
    Importing a Contact List CSV to the iPad
    http://techchannel.radioshack.com/importing-contact-list-csv-ipad-2235.html
    iOS: ‘Mailbox Locked’, account is in use on another device, or prompt to re-enter POP3 password
    http://support.apple.com/kb/ts2621
    iCloud: Create a group and add contacts to it
    http://support.apple.com/kb/PH2667
    eMail Groups - You can use a third party app that many users recommend.
    MailShot -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    Group Email -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Configuration problems with IMAP e-mail on iOS with a non-standard SSL port.
    http://colinrobbins.me/2013/02/09/configuration-problems-with-imap-e-mail-on-ios -with-a-non-standard-ssl-port/
    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
    How to delete an email account on your iPad
    http://www.shoppepro.com/support/knowledgebase/228/How-to-delete-an-email-accoun t-on-your-iPad.html
     Cheers, Tom

  • How do l delete all the text in my InDesign document in one go?

    Hi
               I managed to get the solution to my formatting problems for my book in InDesign CS6. I'm scared that with all the messing about something may have gone wrong. Is there a quick way to just delete the text - ie leave headers, footers and page numbering in place as well as the settings for automatically adding page numbers. I tried to sort this last night but the only solution I found seemed to want to take the whole page out and I don't want to go through all the setting up of headers, footers, page numbering and of course all the associated place holders. Anyone got a solution?
    John

    Hi Peter
                         I'm not sure I completely understand. The file is simply a 200 page+ Word document that was autoplaced in InDesign. You've been really helpful to me with this In Design document - thankyou. What I'm getting at is that because I increased the gutter size to comply with printing specifications after I placed the Word document for the first time - some text that was on page 100 and was the start of a chapter - and therefore had no header, now appears on page 110 in the new file which in the original placing of the text had got a header and footer on. All I want to do is delete the story text - ie the Word document that was autoplaced.
    Cheers Peter

  • How do I delete all of my photos from my "photo library,""iPhone,""My Snap

    Please help! I have too many photos and while I have managed to download my "camera roll" photos to my PC, my photo library & iPhone still have 6052 pictures!! I already have all of these photos on my PC and they are on a back up as well. I just need to know how to delete them from my iphone so I have some storage room for apps and music.
    THANK YOU FOR YOUR TIME AND ANSWER(S). I SINCERELY APPRECIATE IT!

    The phone has to be plugged in. Across the top of the iTunes once you have selected the device are Summary, Info, Apps, Ringtones, Music, Movies, TV Shows, Podcasts, iTunes U, Books and the last one is photos. On that tab remove the checkmark next to Sync Photos from: If you cannot see this on your screen, your screen resolution may be too low. You will need to increase the resolution so you can see it. I don't use Mac, so I'm not sure what you will need to do, but that is where you should find it.

  • How do you delete all your data permanatly from iCloud?

    My friend just experienced syncing problems, some of his calendar to dos and other appointments simply would not show up, he brought his iPhone over and what do you know, i found out he had iCloud on and syned all his private data with iCloud, basically the world, and he is a public figure.
    Now what i find more interesting is that he says he never set up iCloud or wanted to use becuase of fear its in a cloud, can be hacked, and that he disagrees how apple wants access to all his private files., this is true regardless of words used to assure users to go ahead and put anything online.
    Now he wants to erase everything possible, he also is seeking an attorney to let him know what happened to investigate a possible hack here, since he never set up iCloud at all or knows how.
    Does anyone know how to erase iCloud data at least from the user end?

    If you are seeking to take legal action about anything, the last thing you do is post it on a public forum.

  • How can I delete all of my information from iCloud...permanently and forever...without deleteing anything from my iOS device?

    After all of the buzz surrounding the iCloud hacking incident, I went to see if anything was on my iCloud account and found that, contrary to all of the settings I applied when iCloud was originally launched, it had somehow managed to get all of my contacts, my reminders and my calendar.  Since I do not trust any technology's security, I try to minimize my risk by minimizing where my information gets stored.  I was shocked to find that iCloud actually had my all of this informaiton even after I'd been very intentional to never allow anything to be sync'd to the cloud.
    Any help would be appreciated.
    Thanks

    Create your own user account on your computer, open iTunes, log into your iTunes account on the iTunes Store then sync your iPhone.
    http://support.apple.com/kb/HT1495

  • How Can I Delete all Time Machine Backup From Computer Hard Drive?

    Can somebody help me on this. I don't want to use time machine anymore because i have low volume External hard Drive(500GB) only but want to do manual buckup.

    Hi,
    If you no longer want to use the Ext Drive with TM...
    Turn TM Off and Erase the Ext Drive using Disc Utility...
    Cheers,  
    If you need more detail... See this Older Discussion:
    https://discussions.apple.com/message/7185763#7185763

  • CS3/4, JS Amateur question: how remove all empty text frames?

    I'm an amateur, and thought it would be a straightforward matter to write a script that simply deletes all empty text frames in all of a document's stories. Here's my second attempt:
    var myDocument = app.activeDocument;
    var myStories = myDocument.stories;
    for (i = 0; i < myStories.length; i++){
      var myStory = myStories[i];
      var myTextFrames = myStory.textContainers;
        for (j = myTextFrames.length - 1; j >=0; j--) {
        if (myTextFrames[j].contents == "") myTextFrames[j].remove();
    The trouble is, sometimes it works as intended, but sometimes, with multiple stories, it needs to be run more than once. Can anyone explain why that is?
    Thanks -- Jeremy

    [Jongware] wrote:
    (Bit of a Johnny-come-lately, but anyway )
    AHA! -- This is a great help. It was driving me up the wall, and I don't know why it didn't work for me last night. Maybe it's because I was counting through stories in the wrong direction. Anyhow, I see how it works now, and I'm very grateful for the help.
    By the way Harbs, I used all three of your suggestions because I had spent far too much time tapping away at that nut with my little toy hammer. I vented my frustration by using all three of your sledgehammers. In particular, I made sure it left a single empty text frame where it was, as such a frame might be used as a graphic. (Although in the past, I've found an empty story can be a sneaky place for a rogue font to hide. The insertion point just in front of the "end of story" character can have a paragraph style applied, with its associated font, but "Find" won't find any characters with that paragraph style or font applied!)
    Thanks to all again -- Jeremy

Maybe you are looking for