Find and delete graphic lines by geometric bounds

Hi everybody,
I am really desperate after days browsing the web and forums I still can't figure this out.
I am working on InDesign CS3 on a MacBook Pro with Snow Leopard.
I have a 300 page catalog put together through a data merge. Unfortunately this way I produce 2 graphic lines at the end of each page that I would rather like to delete. Since I do not want to do that manually on each page and since I will have to put together this catalog quite frequently in the future I would like to delete those lines using Applescript.
Since I have about 12 more of the same lines on each page (same style, color, stroke etc) I figured the only way to tell Applescript which ones to delete is by geometric bounds because those lines are always at the same coordinates on each page.
Unfortunately I cannot figure it out. I tried the following code:
tell application "Adobe InDesign CS3"
     tell document 1
          repeat with oneFrame in (get graphic lines whose stroke weight = 1)
               if geometric bounds of oneFrame is {0, 0, 0, 210} then
                    delete oneFrame
               end if
          end repeat
     end tell
end tell
REPLY
tell application "Adobe InDesign CS3"
     get every graphic line of document 1 whose stroke weight = 1
          --> {graphic line id 187 of page id 177 of spread id 172 of document "Untitled-16"}
     get geometric bounds of graphic line id 187 of page id 177 of spread id 172 of document "Untitled-16"
          --> {0.0, 0.0, 0.0, 210.0}
     delete graphic line id 187 of page id 177 of spread id 172 of document "Untitled-16"
end tell
This worked fine for the line placed at x 0mm y 0mm with a length of 210mm.
I tried the same thing with a line at x 3mm y 134mm length of 210mm with the following code
tell application "Adobe InDesign CS3"
     tell document 1
          repeat with oneFrame in (get graphic lines whose stroke weight = 1)
               if geometric bounds of oneFrame is {134, 3, 134, 213} then
                    delete oneFrame
               end if
          end repeat
     end tell
end tell
REPLY:
tell application "Adobe InDesign CS3"
     get every graphic line of document 1 whose stroke weight = 1
          --> {graphic line id 213 of page id 177 of spread id 172 of document "Untitled-16"}
     get geometric bounds of graphic line id 213 of page id 177 of spread id 172 of document "Untitled-16"
          --> {134.0, 3.0, 134.0, 213.0}
end tell
This was my best shot. No idea if I am on the right track or totally off bounds.
Any help would be highly appreciated!
Thanks in advance..
Osinho

Good Morning Mary,
Thank you for your reply.
I found a solid solution using a different approach.
It seems like the geometric bounds selector is not accurate for values with decimal values like 149.267 because in reality this value is 149.266666666666666666666667 (period 6). Since some of my lines have such a pattern it just won't work (that's the only explanation I could come up with...)
Nevertheless here my solution:
The lines that have to be removed are always the last 2 lines of a total of 12 lines on a page. Knowing that I incorporated a running index telling the script "please delete only the lines with index 11 and 12" once the max count of 12 per page is reached I reset the index so it starts from scratch for the next page. Works like a charm!
(don't get confused because I count down from 12 to 1 - this needed to be done because the loop starts at the bottom of the page rather than at the top)
Here the code:
tell application "Adobe InDesign CS3"     
     tell document 1
          set lCount to 12
          repeat with oneFrame in (get graphic lines whose stroke weight = 1)
               if (lCount is 12 or lCount is 11) then
                    delete oneFrame
               end if
               if lCount is 1 then
                    set lCount to 13
               end if
               set lCount to lCount - 1
          end repeat          
     end tell
end tell
Thank you very much for your assistance!
Highly appreciated!
Have a great weekend...
Osinho

Similar Messages

  • HELP!! How can I find and delete duplicate mp3 files.

    I have a zillion copies of songs and I want to find and delete duplicate mp3 files. I have used MediaRage to find the duplicate files (16 thousand or so) but it can't delete them. It will take a million yrs to delete them manually. Does anyone know a way to do this quickly or a program that will do this for me. I have a 15 in Powerbook with OS 10.5.3
    Thanks so much if you can help.

    This site: http://dougscripts.com/itunes/ has hundreds of scripts (small programs that do stuff) for iTunes.
    Bound to be something there for you.

  • My start up disk is almost full, but I have deleted everything I can find - I think that when I upgraded my software it has saved the old one - anyone know how I can find and delete it?

    Hi All,
    Late last year I upgraded from tiger to leopard (very out of date I know) but ever since I have been getting warnings that my startup disk is full.  I have deleted loads including pictures and itunes but still get the same mesage.  I think when I upgraded the old version was stored somewhere and this might be causing the problem.  Does anyone know where I would be able to find and delete - or alternatively have any other suggestions for what the problem may be?
    Many thanks

    WOW
    80GB is a very small drive. 
    Sorry Noondaywitch, but omni disk sweeper isn't going to install in the space remaining, without more problems. 
    My Suggestions
    1.  Get a large (400GB+) USB hard drive
    2.  Copy all the contents of your home directory to the USB drive.
    3.  Delete all your files from your home directory on your computer after making sure everything transferred ok.
    4.  Perform a clean (destructive) install of Mac OSX and then the applications you need.
    5.  Check how much space you have left.
    6.  If there is less than 50% of the HDD space left (35GB or so), then consider replacing the HDD with a new larger one.  If it's a white intel mac book, then this is very easy, and instructions how to do it are included in your 'everything else' wallet with your OSX DVDs etc.
    7.  If you can't replace the HDD, then it's time to consider a new machine i'm afraid.
    Hope this helps
    Justin

  • I used time machine to restore on a formatted MAC. Now the HDD space has reduced by 100GB but I cannot see any of the files. How do I find and delete those 100GB data from the HDD?

    I used time machine to restore on a formatted MAC. Now the HDD space has reduced by 100GB but I cannot see any of the files. How do I find and delete those 100GB data from the HDD?

    dglenn9000 wrote:
    I created a new user account just to see if it was my user Library or if there was something wrong with my system. And the new user account is doing most of the same things so I will need to do a full restore anyway.
    Not necessarily. I'd suggest downloading and installing the "combo" update. That's a combination (thus the clever name) of all the updates to Leopard since it was first released, so installing it should fix anything that's gone wrong since then, such as with one of the normal "point" updates. Info and download available at: http://support.apple.com/downloads/MacOS_X_10_5_8_ComboUpdate Be sure to do a +Repair Permissions+ via Disk Utility (in your Applications/Utilities folder) afterwards.

  • I used Duplicate Annihilator to isolate dups in iPhoto on my iMac. At the end it told me it had marked the word duplicate in the comments / description field. How do I find and delete the marked photos?

    I used Duplicate Annihilator to isolate dups in iPhoto on my iMac. At the end of its search, it told me it had marked the word duplicate in the comments / description field. How do I find and delete the marked photos?

    File -> New Smart Album
    Description -> contains -> Duplicate
    will find them.
    Then the keystroke to delete depends on which version of iPhoto you have. All the keyboard shortcuts are under the Help menu.

  • When I connect my iphone to my itunes it says loads of space is being taken up by documents , however i have no documents saved on my phone to my knowledge. how do I find and delete these hidden files ?

    when I connect my iphone to my itunes it says loads of space is being taken up by documents , however i have no documents saved on my phone to my knowledge. how do I find and delete these hidden files ?

    I restored the phone so had no apps on it at all and there was still this certain amount of space used up by documents ! I've already had it in to the apple store and they didn't seem to have a clue either ! Ugh ! Wouldn't mind so much if the phone was free with a contract but I actually spent 450 quid buying this phone and it's always full of "nothing" so virtually unusable

  • How do i find and delete duplicate images in Photos? Help please!!

    With all the image sharing me and other half do my Photos library is FULL of duplicate images.. I need a quick and easy way to find and delete them. I've tried a couple of the free apps in the app store, but because the Photos library isn't a regular folder, they won't work! My library is way to
    big to manually scan through too.
    Any advice would be hugely appreciated!! Thanks in advance!

    Hi Keith,
    Thanks for the advice! However, it's not possible find the really large files this way since file size is not a smart album option. There are too many movies to find them manually.
    Best regards,
    Anders

  • How do I find and delete duplicate photos in iPhoto?

    I have used iPhoto for many years and I have quite an extensive collection (13k+) and I am sure that I have many many duplicates. Is there a way to find and delete simply any duplicates that have consumes my library?

    That is not a feature of iPhoto - suggest to Apple - iPhoto Menu ==> provide iPhoto feedback.
    LN

  • How do i find and delete duplicate in my song library???????

    How do i find and delete duplicate in my song library???????

    Under the file tab in iTunes, select Display Duplicates. From there you can delete them as well.

  • HT201250 How do I find and delete local backups.  This is taking up over 200g of space on my MBP

    I recently looked at my hard disc drive and backups were taking over 200gb of space.  I used the terminal command to stop taking local backups, but when I rechecked disc space it only moved the space from backup to other. 
    Is there a way to find and delete this files?  Then I can start fresh with Time Machine.
    Thanksm
    Tp

    You don't need to delete local snapshots. They're delete automatically when free space falls below a certain level.

  • How can I find and delete duplicate files in Mt Lion?

    As a competent, but self-trained mac user for 30 years, I'm totally baffled by the sudden appearance of multiple duplicate documents and .jpgs in my imac files. How can I find and delete them?

    Duplicate Annihalitor - http://brattoo.com/propaganda/ - or Decloner - http://www.pixelespressoapps.com/decloner/
    LN

  • How can I find and delete duplicate photos?

    How can I find and delete duplicate photos in iPhoto 2011?

    Duplicate Annihalitor - http://brattoo.com/propaganda/ - or Decloner - http://www.pixelespressoapps.com/decloner/
    LN

  • How to find and delete duplicate photos in photo app

    how to find and delete duplicate photos in photo app

    Photos has no built-in tools to screen the library for duplicates. It relies on the warning on import, that should prevent you from importing duplicates.
    Once duplicate shave been imported, delete them manually, or use third-party tools.
    For example, these new apps claim to work with Photos:
    Power photos:  Fat Cat Software
    Duplicate annihilator: Brattoo Propaganda Software - Products
    PhotoSweeper: http://overmacs.com/photosweeper.html

  • A mysterious audio file opens when I open my browser. How do I find and delete it?

    A mysterious audio file opens when I open my browser. How do I find and delete it?

    The other possibility is that someone with access to your machine (children?, co-worker?) set up all of your browsers to have that audio file set up as a default "home page". This is probably more likely than malware. I just tried with Safari, and it's definitely possible. Check out your Safari preferences and see what it shows as your homepage.

  • How do I find and delete old plugins

    Since my leopard days I have been migrating data over as I updraded to the new OSX 10.9. When I start to open apps. Pro tools, Logic x, and otehr DAWs, there are some plug ins that are not compatable. Rather than leave a bug, and taking more time to launch my apps, how can I find and delete some of the plug ins that are 32 bit that don't work with 64 bot applications.
    Just house cleaning. Thanks.

    Under the file tab in iTunes, select Display Duplicates. From there you can delete them as well.

Maybe you are looking for

  • WINWORD.EXE -Application Error The application was unable to start correctly (0xc0000142). Click ok to close the application

    HI  when i am trying to open MSWord following message pop up and i can't open MSword any more: WINWORD.EXE -Application Error The application was unable to start correctly (0xc0000142). Click ok to close the application. Please advise 

  • Problem in portlets

    the problem is i make an apllication in faces but when i converted to portlets i convert to winrar file and deploy on portal container but the msg is deployment succesfull but when i wana see the deployed portlet wat i get just a boring msg Wait..por

  • Unit of Measure "Round up to next Integer"

    Hi All, I have a unit of measure BAG, I have defined it with zero decimal places. When I enter 1.5 it becomes 2 and when 1.49 it becomes 1. I want to round it up to next integer i.e. 1.2 should become 2 and so on... Please suggest how it can be a ahi

  • Erratic behavior on iMac 20

    I returned one computer last week and now have similar problem with the new one. Everything works fine and then all of a sudden, after working fine for days, the background on the desk top will flash dark and back on, any open windows will blue out,

  • How to access a samba share?

    Hi everyone I tried setting up a diskless folding comp to push out a few more PPD, which I did succesfully. On my windows comp when I go to Network Places I can see it in the group "Diskless" I downloaded fahmon to see if I could monitor it, and all