Script that can delete objects by coordinates

I have a long document and I need to delete some text blocks that appear on each page. These executives share the same y coordinate and others who share the same x coordinate. Is there a script that can locate text blocks and remove throughout the document?

I am running Windows so no applescript

Now to the second part:

If you have your current text block, you can read the geometric boundaries. Since you want to find only managers with specific or coordinated x, you only y1 and x 1. Values that may have a large number of decimal places, it's a good idea to round the values, as Peter mentioned.

var curDoc = app.activeDocument;
var allTextFrames = curDoc.textFrames;

var yValue = 11.5;
var xValue = 20;

var nTextFrames = allTextFrames.length-1;

for (var i = nTextFrames; i >= 0; i--) {
  var curTextFrame = allTextFrames[i];
  var gB = curTextFrame.geometricBounds;
  var y1 = gB[0].toFixed(2);
  var x1 = gB[1].toFixed(2);

  if (y1 == yValue) {
    curTextFrame.remove();
  }
  if (x1 == xValue) {
    curTextFrame.remove();
  }
}

Tags: InDesign

Similar Questions

  • Can any body help to get a script that can generate the sequence (length 3) with a combination of numbers and characters example: T11... TA1... TZ9... then on

    Can any body help to get a script that can generate the sequence (length 3) with a combination of numbers and characters example: T11... TA1... TZ9... then on

    With the help of the clause type

    Select sqnc

    from (select sqnc

    from (select 'T00"sqnc, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ordr

    of the double

    )

    model

    size of (0 I)

    measures (sqnc, ordr, length (ordr) len)

    rules iterate (1300) until (instr(sqnc[iteration_number],'~')! = 0)

    (sqnc [iteration_number] = case when sqnc [cv (i) - 1] is null

    then sqnc [0]

    of another substr (sqnc [iteration_number - 1], 1, 1) |

    -case when substr (sqnc [iteration_number - 1], 2, 1)<=>

    so when business substr (sqnc [iteration_number - 1], 3, 1)<>

    then substr (ordr [0], instr (ordr [0], substr (sqnc [iteration_number - 1], 2, 1)), 1)

    of another nvl (substr (ordr [0], instr (ordr [0], substr (sqnc [iteration_number - 1], 2, 1)) + 1.1),'~ ')

    end

    end |

    -case when substr (sqnc [iteration_number - 1], 3, 1)<>

    then substr (ordr [0], instr (ordr [0], substr (sqnc [iteration_number - 1], 3, 1)) + 1.1)

    else ' 0'

    end

    end

    )

    )

    where instr(sqnc,'~') = 0

    Concerning

    Etbin

  • I'm looking for a Script that can list all virtual machines with type of NIC E1000 via the output of the CSV file.

    Hi gurrus and LucD

    I'm looking for a Script that can list all virtual machines with type of NIC E1000 via the output of the CSV file.

    The script should search for information in a multiple Vcenter servers and multiple clusters and list all the VMs name, status (two powers on or off) with type card NETWORK Type E1000 only no other.

    Concerning

    Nauman

    Try like this

    $report = @)

    {foreach ($cluster Get-cluster)

    foreach ($rp in Get-ResourcePool-location $cluster) {}

    foreach ($vm in (Get-VM-location the $rp |)) Where {Get-NetworkAdapter - VM $_______ | where {$_.}} Type - eq "e1000"}})) {}

    $report += $vm. Select @{N = "VM"; E={$_. Name}},

    @{N = 'vCenter'; E={$_. Uid.Split('@') [1]. "Split(':') [0]}},"

    @{N = "Cluster"; E = {$cluster. Name}},

    @{N = "ResourcePool"; E = {$rp. Name}}

    }

    }

    }

    $report | Export Csv C:\temp\report.csv - NoTypeInformation - UseCulture

  • Little VB program that can delete a folder using the current date

    Greetings,

    I try to write a rudimentary program that will delete a file.  I'll post some pseudocode to demonstrate what I intend to achieve:

    If FileFolder is < 8=""> as CurrentDate

    then delete

    I looked at a few other Web sites and ran across something that seems possible to use.  I will credit the site: http://www.vbforums.com/showthread.php?684680-RESOLVED-Delete-files-in-folder-that-are-older-than-a-certain-date

    Private Sub Command1_Click()
    Const FromFolder = "D:\seenu\from\" ' change the path
    Const FilePattern = "* .log" "change the model
    Dim file As String

    File = Dir$ (FromFolder & FilePattern, vbNormal)
    Len (File) > 0 do
    If Date - FileDateTime (FromFolder & file) > 60 then
    'Delete file '.
    End If
    File = Dir$)
    Loop
    End Sub

    However, I'm not above trying to achieve, I don't know how tell the program to look at the date of the day of the machine and then determine anything more than 8 days before the current date should be deleted.

    Once this program is completed and updated, I intend to have Task Scheduler running on a daily basis.

    Sincere greetings,

    TI banker

    Hello

    You can try asking the question in MSDN to support forums:

    https://social.msdn.Microsoft.com/forums/vstudio/en-us/home?Forum=vbgeneral

    I hope this helps.

  • How to create an effective script that mass deletes snapshots

    our company is currently using a product that drives the operating system and software updates for our virtual machines and takes a snapshot before pushing updates in case something breaks. the problem is that the same software does not remove the pictures until next update button and you're just too long we wait with snapshots lying around. what I did to remedy this situation is I built the below script and configured it as a task.

    # Add the snap-snap powercli in
    Add-PSSnapin VMware.VimAutomation.Core

    # Connect to an instance of vCenter
    $strviserver = "vCenterServer".
    SE connect-VIServer $strviserver

    # Get all of the snapshots for each virtual machine in the vcenter, then delete them
    Get - VM | Get-Snapshot - name "updates" | Remove-Snapshot - confirm: $false

    # Remove the snap-snap powercli in
    Remove-PSSnapin VMware.VimAutomation.Core

    It works, but it is not nearly as effective as I wish it were. Essentially, the script currently removes a snapshot at a time right now. I want so he can find any snapshot on this server vcenter by the same specified name and submit the task deletion-Snapshot for each snapshot at the same time. This should cause a lot of tasks to try and tail. The effective result would be that vCenter will treat all instant destruction because it has resources to do in a given time and will address the queue there resources.  If someone can tell me how to do this or something better, I would really appreciate it! Thanks in advance!

    You can consider using the RunAsync switch on the cmdlet Remove-Snapshot .

    In this way, that the script will continue while delete the snapshot is still running.

    Note that there is obviously that a limit on how many parallel snapshot removes that may occur due to the resources available.

  • A script that can send values to the transformation Panel?

    Hi all.

    I wonder if this is possible in a javascript:

    An object is selected.

    Run the script

    B. fill in value in two fields B2: (RADIUS (or diameter) and a B3: number of objects)

    C. it gives two different values, according to a calculation (Horizontal and Vertical)

    D. effect > distort & transform > transform... face is open and she entry fields now have

    the value of B3 (minus 1) in the Copies field (B2 is not necessary) and

    the new C values in the horizontal and the vertical two entry fields.

    The point by in order to distribute copies of an object in a circle where the original object is to flat 12 (top) and the diameter of the circle is a known size.

    I have already made me a calculator to understand this, but my dream would be to have a script or a panel that would do the math and send the result to the Tramsform Panel.

    The calculator is here: IllustratorCircleCalculation.xlsx

    An article that explains is here: http://font.is/calculate-multiple-objects-in-a-circle-in-illustrator/

    I'd like to hear some tips. In fact if someone would do this I would be happy to distribute the formulas behind the calculator.

    Hi Samantha, unfortunately there is no access to the effects or native dialog fields... it might be possible to hack sending keystrokes to illustrator, but this is a crazy idea.

    I'd be more inclined to select an object, and then run a script to distribute a number of Copies, a given circle round, as in your tutorial clock... This seems doable with javascript.

  • To create an automatic script that can start Mozilla Firefox in Incognito

    work with the marketing of the http://www.wireflydigital.com/ agency want to script for a http://www.dryfruitmart.in client, which can open Mozilla Firefox directly in incognito and no mode of the screen.
    any suggestions...?

    Right-click on the desktop and choose NEW - shortcut - "C:\Program Files (x 86) \Mozilla"-private-window http://www.dryfruitmart.in/

    Works great also

  • Script that can check for missing fonts

    In this script for use in InDesign CS3:


    var doc = app.documents[0];
    var mExitFlag = false;
    
    var mTextFrames = doc.textFrames;
    for(var i = 0; i < mTextFrames.length; i++){
        if (mTextFrames[i].parentStory.overflows && checkIfOnPage(mTextFrames[i]) && mTextFrames[i].itemLayer.visible == true){
            alert('To much text' )
            mExitFlag = true;
        }
    }
    
    var mLinks = doc.links;
    for(var i = 0; i < mLinks.length; i++){
        if ((mLinks[i].status == LinkStatus.LINK_MISSING || mLinks[i].status == LinkStatus.LINK_OUT_OF_DATE) && checkIfOnPage(mLinks[i].parent.parent) && mLinks[i].parent.parent.itemLayer.visible == true ){
            alert('Missing or not updated link' );
            mExitFlag = true;
        }
    }
    
    
    if(mExitFlag){    
        exit();    
    }
    
    function checkIfOnPage(mItem){     
        var _OldZeroPoint = app.activeDocument.zeroPoint;    
        app.activeDocument.zeroPoint = [0,0];    
        
        var _Width =app.activeDocument.documentPreferences.pageWidth;    
        var _Height=app.activeDocument.documentPreferences.pageHeight;    
        
        
        var _Bounds = mItem.geometricBounds;    
        
        if ((_Bounds[3] < 0)  || (_Bounds[1] > _Width) || (_Bounds[0] > _Height) || (_Bounds[2] < 0)){    
            return false    
        }else{    
            return true    
        }    
        app.activeDocument.zeroPoint =_OldZeroPoint;    
    }
    var doc = app.activeDocument;
    var _PDFExportPreset = app.pdfExportPresets.item('NewspaperAds_1v4_IND4');
    if (_PDFExportPreset == null){
       alert('Preset missing');
       exit();
    }
    var _DocName = doc.name.replace(/\.indd/, "");
    var _EndNumber = parseInt(_DocName.match(/\d{3}$/),10); /* extract end number */
    /* test if is a number */
    if (isNaN(_EndNumber)){
        alert('End document name is not a number');
        exit();
    }
    
    

    I also want to check for missing fonts - is it possible?

    I found this online earlier and use it regularly. missingItem is the variable too assign the missing font, do with it as you wish.

    var missingItem = "\n".

    var usedFonts = document.fonts;

    for (var i = 0; i)< usedfonts.length;="">

    If (usedFonts [i] .status! = FontStatus.INSTALLED) {}

    missingItem += "\n" + usedFonts [i] .fontFamily;

    }

    }

  • Photoshop script that records with different active layers?

    Greetings. Long time user of Photoshop... but looking for a way to streamline some workflows. I regularly jobs where I need to create variations of what I am working on. To do this, I have basic layers that are common to all the images of finals, can have a set of layers that have sections which vary on them. Now, I heard some Scripts that can be run in Photoshop, so I was wondering if there is a way to have such a script all variants, evolution which layers "variation" is visible, as it does. Thus, if the layers were piled up like:

    Overlay shared

    Variant 6

    Variant 5

    Variant 4

    Option 3

    Variant 2

    Option 1

    Shared content

    Shared base

    All shared layers would be visible, while the script would save the Variant 1 file with the Variant 1 layer visible also... Variant 2 with Variant 2 visible (and Variant 1 tilt turn back), etc. Such a thing is possible in Photoshop with the script? And if so... How capable is he? If the file format was more like:

    Overlay shared

    Level 2 option 3

    Level 2 option 2

    Level 2 option 1

    Variation of 1 level 3

    Level 1 Variant 2

    Variation of 1 level 1

    Shared content

    Shared base

    When I needed to save the files where the script activated level 1 Variant 1, then saved on each of the 3 files with the level 2 variants (file1 would have level 1 Variant 1 + level 2 option 1 active, then File2 should have level 1 Variant 1 + level 2 option 2 active... etc)... is it possible?

    Not necessarily need someone to provide a script, I'm pretty happy to jump in and learn, if I get an indication that I wouldn't just spinning my wheels on something that is not possible. Thank you, in advance, for all the answers.

    Yes, this would be possible. If the files have different numbers of layers, which would make it more difficult, because you'd have to this script so that the script know which layers to enable or disable. It would be just a matter of creating a 'loop' and going through the layers. It would be worth something even in the name of the layer that would leave the script to know which layer must stay all the time.

  • Possibility to create a script that automatically opens files and processes?

    I have a folder on my computer which has automatically downloaded image files periodically. I would like to have a script in photoshop that can batch process them automatically and then move them out of the folder so that they are not treated again - but I just wanted to know if it was common or even possible. I do a lot of scripts, but I'm good enough to understand things if anyone has information or examples of scripts that can do something like that, that would be greatly appreciated. Thank you!

    Did you search Forum yet?

    Re: folder

  • How can I autorun script that will process an XML file at the opening?

    I use image 11. I have a saved script that looks for the event Constants.FA_Note_PostOpenXML notification. When this event is raised, the script is supposed to examine the root element (so I change only the appropriate XML files), then make some changes to the file. Specifically, I want to be able to delete empty pages, remove the room for the heads side and correct table formatting (for example the left indent, whereby I can not directly access, apparently, in the rules of the EDD or R/W). The code snippet that starts to do the following work:


    Notification (constants.FA_Note_PostOpenXML, true);

    function {Notify (note, object, sparam, etriqu)

    switch (note) {}

    case Constants.FA_Note_PostOpenXML:

    doTheWork();

    break;

    }

    }

    function doTheWork() {}

    var doc, flow, root, elemName, mPageAttrib, topicElem, topicElemName, allAttribs;

    doc = app. ActiveDoc;

    flow = doc. MainFlowInDoc;

    root = flow. HighestLevelElement; will always get something although unstructured document

    While (root. ObjectValid()) {//only do something for structured documents

    elemName = getElementName (root);

    .. more code to do things...

    }

    }

    I check then the element name root, and if it matches, I make a few changes. This code works fine when operating manually. But, when it is run as a recorded script, the app. ActiveDoc object is invalid, and there is no structure to edit. (I added the line if(!doc.) debug ObjectValid()) {alert ("invalid");} that is not included above.) It seems that the Constants.FA_Note_PostOpenXML event fires whenever the XML file opens, but BEFORE frame bed actually.

    Does anyone have recommendations on how to get around this? Is there something else I could use instead of Constants.FA_Note_PostOpenXML? Is there another way to manipulate an XML file automatically when loading?

    Thanks in advance

    The notification event receives four settings: note, object, sparam and etriqu. For the event that you are using, the object must be the subject of document of the FrameMaker document being opened. Then, you should be able to use this:

    doTheWork(object);
    

    Make sure that you update your doTheWork function to receive the Doc object:

    function doTheWork(doc) {
        var flow, root, elemName, mPageAttrib, topicElem, topicElemName, allAttribs;
        flow = doc.MainFlowInDoc;
        root = flow.HighestLevelElement; // will always get something even if unstructured document
        while(root.ObjectValid()) { //only do something for structured docs
            elemName = getElementName(root);
            ...more code to do stuff....
        }
    }
    

    -Rick

  • How can I prevent the Thunderbird auto fill email addresses that I deleted?

    Thunderbird fun to auto fill email address that I deleted. How can I stop this?

    If they were not in one of these 2 books that Thunderbird could not provide them as a suggestion.
    Sometimes contacts added to a book without all the info and does not seem to appear. You can find them by starting an email and it was addressing the problem email address. Save the email in drafts.
    Now go to the drafts folder and select the message by clicking it once.
    Make sure that the message pane is enabled in the drafts folder. F8 activates / deactivates the message on and outside pane.
    In the message header at the top of the message pane the info From that will be you and the info that will be the address of problem will be displayed. To the right of the addresses is a star. If the star is filled with the color, the address is in one of your address books. Click on the star and open an edit dialog box. This box will tell you which book is the contact, but more importantly, is there a delete button when you remove it.

  • Is there a quick delete button that can be added next to emails?

    During playback by emails in Thunderbird there are emails that I know I want to read and remove enough quickly without having to click on the email itself.

    What I'm looking for, it's a quick delete button similar to the 'star' button that can be added as a column. I would like a button which is located near the titles of message in the e-mail pane that allows me to quickly delete messages.

    Microsoft Outlook (windows mail) has something like that on all messages and I would if this feature could be reproduced in Thunderbird.

    It's not Outlook and there is not this button. Right click - Delete the Message

  • AVG says your messed up my Verizon Yahoo's email server. The line that bed, delete, move, not spam, but... does not load. I can see my email, I just can't open

    I spent over 5 hours in computer shares with AVG. They said your server messed up my email account. I can access my email account, but the line that reads "delete, move, not spam, more' loads ever... so I can't delete the email or anything else. My email account is to verizon yahoo. I need access to my email for various reasons, one of them being pay several bills online and my email account is where to get confirmation that the payment has gone through! My email works through IE, however. I don't want to use IE to see my email... I use Firefox for everything and it would be a pain in the end to have to switch to IE to access my mail. Not to mention, I hate IE - it's like using WEBTV! It's so slow... [address removed by email, please do not provide sensitive information in a public forum] is my email...

    So Safe Mode made no difference?

    To test how Firefox works no 'custom' on your system, could you experience in two minutes?

    Create a new Firefox profile

    A new profile will be your plugins installed by system (for example, Flash) and extensions (e.g., security suite toolbars), but no themes, other extensions or other customizations. It should also have databases of completely fresh settings and cool a cache folder.

    Out of Firefox and start in profile to help Manager start > run:

    firefox.exe -P
    

    Do not delete anything here.

    Any time want to switch profiles, exit Firefox and return to this dialog box.

    Click on the button to create a profile, assign a name like TEST and skip the option to choose a different folder location. Then launch Firefox in the new profile that you have created.

    Yahoo does not improve in the new profile?

    When you return to the Profile Manager, you might be tempted to use the button Delete a profile on TEST. It's a little too easy to accidentally delete your 'real' profile, so I recommend you to resist the temptation. If you don't want to clean up later, I suggest to make a backup of all your profiles first in case something go wrong.

  • Can not put just one or two albums on my iphone without songs that I deleted previously being in sync too

    I've had this problem for a while and can't seem to find what I'm doing wrong. Whenever I drag an album on my iphone it says "update files" and then more than 200 songs that I deleted are back on my phone. Cancel the update, but this happens every time

    I would recommend the synchronization of the device with a playlist selected, rather than manage manually. You update the playlist and then synchronize to update the device with the changes.

    The following steps should resolve problems with the device, do not sync what is selected, or to remember a previous selection, copying it back.

    1. Backup device.
    2. Restoration as a new device.
    3. Restore the backup that you made earlier.

    TT2

Maybe you are looking for

  • HP Pavilion AIO 23-q010in: get the drive recovery during the warranty

    One of reinstall drive does not... so get another set drive recovery during the warranty period...?

  • Cannot map a shared folder

    I have two computers, X and Y. I want to the map on X, a share named htdocs, who lives in the computer Y.  Both are Windows XP. X has ip 10.22.204.87 There's ip 10.121.241.140 X belongs to a domain. Belongs to a workgroup. Y, I have an administrator

  • HP Photosmart C4680 duplexer

    I have a HP photosmart C4680 pinter and I tried to understand what duplexer is compatible with it. I was going to buy this one: http://www.amazon.com/HP-Duplexer/dp/B0018WRNN6/ref=sr_1_2?ie=UTF8&qid=1294256308&sr=8-2 because it seems to be the only o

  • 17 - g161us: Windows 7 drivers for Pavilion 17-g161us

    HI - decommissioning of a Pavilion 17-g161us for W7.  W7-64 bit installed fine, but I can't find drivers for W7 to get work items (particularly difficult without functional network or usb - card I can't even use a USB network adapter).  Can anyone he

  • Hey ~ I need help in Windows Media Player 12, remove album art!

    Hey ~ I need help in Windows Media Player 12, I got some song I want to add in the album art, but I had a song I add in a hard cover and I can't remove... so pls help