Script that checks - and stop - if the text is in excess

In this script:

    var doc = app.activeDocument;     
    var mItems=doc.allPageItems;     
    var len = mItems.length;     
       
    // save measurement unit & set measurement unit to mm   
    //savedUnits = app.scriptPreferences.measurementUnit;   
    //app.scriptPreferences.measurementUnit = MeasurementUnits.MILLIMETERS;   
       
    while(len--){     
        var mItem = mItems[len];     
        var mBounds = mItem.geometricBounds;     
        var mX = getRound(mBounds[1],3);     
        var mY= getRound(mBounds[0],3);     
         
        // fit content  
        if(mX == 10 && mY == 10){    
            mItem.fit(FitOptions.CONTENT_TO_FRAME);   
        } 

        if(mX == 6.999 && mY == 4.801){   
            resizeItem(mItem, 240,340)   
            mItem.move([10, 10]);   
            mItem.fit(FitOptions.CONTENT_TO_FRAME);
        }     
    }  
var doc = app.activeDocument; 
var _PDFfile = new File('\\\\C:/test\\' + app.activeDocument.name.replace (/\.indd$/, '.pdf')); 

var _PDFExportPreset = app.pdfExportPresets.item('MyJobOptionName');  
if (_PDFExportPreset == null){ 
   alert('PDF Export Presets not found'); 
   exit(); 
    }   
    app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES;                     
    doc.exportFile(ExportFormat.pdfType, _PDFfile, false,_PDFExportPreset);   
       
    /* round */     
    function getRound(number, digits) {     
            digits = (digits) ? Math.pow(10, digits) : 1000;       
            return Math.round(number * digits) / digits;       
    }    
    /* resize object */    
    function resizeItem(mItem, mWidth,mHeight) {   
        mBounds = mItem.geometricBounds;   
        mBounds[3] = mBounds[1] + mWidth;   
        mBounds[2] =mBounds[0] + mHeight;   
        mItem.geometricBounds = mBounds;    
    } 

I also need the script to search for text in excess.

So, something like this.

1. If there is a textbox that contains text overset the scipt must stop all other actions in the script and warn on this subject.

2. If there is no textbox text overset the script is run just with all actions.

Hello

Paste this snippet at the beginning of your code...

var doc = app.activeDocument;
var mTextFrames = doc.textFrames;
for(var i = 0; i < mTextFrames.length; i++){
    if (mTextFrames[i].parentStory.overflows){
        alert('Overset TextFrames detected' );
        exit();
    }
}

Tags: InDesign

Similar Questions

  • Often just by filling out a form on a website, Firefox hangs and stops accepting the text. Can be thawed by starting another application unrelated.

    It just happened during the filling in the details area. Firefox has agreed a text then froze. I just erased it by opening the program to the trash on the desktop (it seems to work with any program, I've tried). I had this problem for a few months and is not fixed by updates. It happened twice during the minting of these details. Although I can fix it, it's very annoying. I have no other problems with Firefox.

    This could be potentially because of Add ons or extensions that handle auto completing forms. I recommend that you first make sure that each of your add ons and extensions are up-to-date:

    In order to eliminate add ons or hardware acceleration, try Firefox Safe Mode:
    

    Try Firefox Safe mode to see if the problem goes away. Firefox Safe mode is a troubleshooting mode that temporarily disables hardware acceleration, restores some settings and disables add-ons (extensions and themes).

    If Firefox is open, you can restart Firefox Safe mode in the Help menu:

    • Click the menu button

      click Help

      then select restart with disabled modules.

    If Firefox does not work, you can start Firefox in Mode safe as follows:

    • On Windows: Hold down the SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac: Hold the option key during the startup of Firefox.
    • On Linux: Exit Firefox, go to your Terminal and run firefox-safe-mode
      (you may need to specify the installation path of Firefox for example/usr/lib/firefox)

    When the Firefox Safe Mode window appears, select "start mode safe."

    If the problem is not present in Firefox Safe Mode, your problem is probably caused by an extension, theme or hardware acceleration. Please follow the steps described in the section Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems to find the cause.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. This might help others with the same problem.

  • Printer error: "Print filter Pipeline host has stopped working" Dell V505 whatever that means and what is the fix?

    Printer error: "Print filter Pipeline host has stopped working" Dell V505 whatever that means and what is the fix?

    frohnj,

    See if This THREAD helps. It is for another printer, but should work for you printer, too.

    Rick

  • I need to create a curved with type text box that heal and return to the next line in the form of curved text. How do I do that?

    I need to create a curved with type text box that heal and return to the next line in the form of curved text. How do I do that?

    1. Draw a set of concentric half circles also spaced, stacked so that the outermost is the most remote.
    2. Use the text tool to add text to the outermost path, thus creating a PathType object.
    3. Select all the paths. Type > threaded text > create.
    4. Text tool: click at the end of the text in the object of PathType. Continue typing.

    > If I do that it will not type more.

    A Warp effect is a direct effect. When it is applied to the type of objects, they are still editable text. The chain will deform, however, the text also, not only the paths to which it is attached. Sometimes you want that, sometimes you don't have.

    JET

  • WMP will open the VTS_01_1.VOB and stop at the end of this file

    I don't know if this is the place to post this question, but it's here.

    I created a web page that lists the cover images all my DVDs that I have on an external hard drive and each cover image is related to the first file VTS_01_1.VOB for this DVD.

    I test page to see how it works for each device I have.  The page works perfectly with my tablet from Samsung, the player on the Tablet, I installed automatically go VTS_01_1.VOB, VTS_01_2.VOB and so on until the movie is done.

    If I use my pc Windows 7, WMP will open the VTS_01_1.VOB and stop at the end of this file, how can I get WMP to continue to the next file automatically?

    Personally, I would check the source code of the Web page of the first.

    Paste the full path to the video_ts.ifo file in a new MS Word document and save it as htm.  Then run the file [it should open in your default browser], then right-click on the page and select view source.  Find the link - it should look like

    href ="... / SomeFolder/VIDEO_TS. IFO "> D:\SomeFolder/VIDEO_TS." IFO

    assuming that D:\SomeFolder/video_ts.ifo is the text that is displayed for the link

    Then go to your actual Web page and discover its source to verify that the link contains this model.

    If the solution is not as simple as that, then you will need to post a question in the section Web & networks of this forum I don't know enough about writing for the Web page.

    To increase the chances of getting there help please include a description of what happens when you try to click on the link - rather than 'will not work.

  • Records of Vista Media Center starts and stops at the wrong time

    I use Windows Vista Home Premium, SP1 and that you may have noticed that when I schedule recordings for some a particular channel, Media Center starts 2 minutes beforehand and ends 2 minutes in advance.  This affects only shows record from my local affiliate Fox - all other shows for other strings start and stop at the appropriate time.

    I checked the system clock with the start times of the shows and both are correct.  In fact, I saw one day Media Center started to record for a show that did not begin until 08:00 at 19:58 (according to the system time).  I had my TV on at the same time and was able to verify that the program in question had not yet begun, so the flow of the internet was sychned with the dissemination of local transmission.

    It's very frustrating because I miss the end of some shows and cannot always extend registration ends because I'm ordering another channel, the next hour.

    I have the same problem with the FOX network...

    -1 make sure your clock automaticly sets in the internet and update once by pressing the link (which makes that he can see the time server)...

    There are two ways you can go with this:

    -If your departure time is correct, then just go to the Planner and choose the program (or series) you are trying to install, select the recording settings (or adjustment of series) or advanced setting... There is an option to "stop recording" 1 min, 2 min, 3 min, 5 min, until 2 hours after the recording is finished... I have mine set to 5 minutes after, and she fixed it...

    -If the starting time is disabled (as mine is), to enter ERM and manuver to tasks > settings > TV > recorder > recorder defaults

    This is where you define all the flaws of the recorder, find "Start when possible" and "Stop when possible", 4 min value (max allows MCE)... Save and exit, restart the machine too...

    You should be good to go...

    PS, I just read the last sentence in your post, you must only have a tv tuner card in your machine (I have two, and that's the reason why I bought two), so you can always have a problem when recording two different channels (back to back on the same channel should work okay).

  • When I have something to stick in wordpad and then change the text, I'll then on preview before printing and most of the time the whole document is not there.

    Original title: need help with wordpad problem

    When I have something to stick in wordpad and then change the text, I'll then on preview before printing and most of the time the whole document is not there. I double space between lines and all that is more than one page disappears. I tried all the different formats (no envelope, window envelope, etc.). How can I fix?

    Hello

    ·         What happens if you use another application to preview before printing?

    ·         You are able to print the document correctly, or you receive no error message when printing?

    You try to use Microsoft Word or Notepad to check if you face the same problem.

    First of all, I would like to check to see if print preview is working on a new empty document with only a word in it.

    If Yes, then the problem is the document.

    You may need to clear any formatting, that depends on where you copied from.

    Your rule of printer drivers print preview

  • Download Itunes on my laptop just before, it starts to install, I get a message saying that windows Explorer stops because the prevention of execution of data has stopped installation

    original title: Itunes and DEP

    While downloading Itunes on my laptop right before you start to install, I get a message saying that windows Explorer stops because the prevention of execution of data has stopped installation.  Is there any solution for this?  I'd like to install itunes on my laptop.

    Hi Steve681229,

    Thank you for using the Microsoft Answers forum.  Here's what worked for someone else.  Thanks Kevin

    Hi thrivenformore,

    Please use the forum for Support of Vista,

    You could try to add iTunes to the DEP exception list.  However, this behavior is not normal.  Go to the support forum of Apple for iTunes for Windows, search on DEP.  There should be a thread "How can I turn off DEP for iTunes?" or it Prevet planting iTunes? "which provide troubleshooting steps you might want to try before adding it to the list of exceptions."

    How to add the program to the DEP exception list:

    1. Press Start, right click on computer and select Properties.
    2. in the window that appears, click Advanced (on the left panel) system settings.
    3. in the first box that says Performance, click on the settings button.
    4. in the window that opens, click the Data Execution Prevention tab at the top.
    5. There should be a box of exceptions in the middle of this window. Click the Add button and navigate to the C: drive, then Program Files, then the iTunes folder, and then choose the iTunes exe.
    6. Add the exception, and then click OK in the window of the DEP.

    Hope this helps, Kevin
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    Thank you for using answers Forum. Please let us know how it works.

    Joseph
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I don't know how to change the size and quality of the text on the screen on Windows 7

    I just installed a new Windows 7 but I don't know how to change the size and quality of the text on the screen.  I tried all the things normal, resolution, size of icons, dpi etc but nothing gives me what I want.  The text in clear 'wonderful' thing is just terrible.  When I go through the 4 steps I see no text boxes which make the text nothing better.  All options are terrible, so the result on screen is too terrible.  When I do any huge I do not get a full screen of things - view the Start button disappears or I did not closing small cross at the top - of the suggestions to inprove the situation?  I must mention that my screen/monitor is 2006 - I need to buy a new one?  How much is this Windows 7 is going to cost me, or maybe I should go back to XP!

    I sincerely thank all you smart "technicians" for all the answers you always gave myself and all others who ask questions.  I'm not too smart with all this new technology as I fell into it very late.  I am now in my 60s and only started using a pc when I was over 50 years so...  In any case, I asked a question about the size of screen resolution and text and received much good advice from all that you guys.  I had recently changed in XP to Windows 7.  However, the bit of advice that I was given in 'Cyberking' here at the Portugal had set the resolution of the screen, the advanced settings, 75 to 60 Hertz Monitor tab.  Very basic, and the first question asked the technician (Lady) was "what size is your screen?  Naturally as a smaller screen that any 'techno' would be considered dead aid, solving the problem was simple and straightforward without me having to stretch my knowledge and my skills by downloading all programes weird (to me) or do the funny stuff in the bios or something else.  I send this comment to you for you to realize that the simple solution is not always bad and maybe we should go for the easiest first and then work up to the more difficult ones.

    Just for you all to see - now my screen resolution is perfect, the text on the screen is clear and legible without difficulty, even though the size of text and icon is small.  Clarity is all!

    Thank you all once again!   Best regards, Blondie blue.

  • Port on which I check and apply in the window properties (XP) when you use a hp photosmart C4280

    Hello, help?

    Can someone please tell me what port should I check and apply in the properties when you use a Deskstop PC running Windows XP on a HP photosmart C4280 printer?

    When I checked the ports in the properties, none have been checked

    Thank you

    Poacherpete wrote: Hello, help? Can someone please tell me what port should I check and apply in the properties when you use a Deskstop PC running Windows XP on a HP photosmart C4280 printer? When I checked the ports in the properties, none have been checked. Thank you

    Hello Poacherpete, I would download the latest version of the software for your printer for Windows XP that's found its

    It is a link that contains information on how to set up your printer in Windows XP. It is a USB cable to the printer connection

  • I created a Javascript script that adds a watermark on the document action "paper print".  This works in Acrobat Pro, but does not work in the drive.

    I created a Javascript script that adds a watermark on the document action "paper print".  This works in Acrobat Pro, but does not work in the drive.  I am a novice using Javascript, so what am I doing wrong?

    Cannot use either addWatermarkFromFile or addWatermarkFromText methods of document with player as shown in the documentation. You can hide/display the form fields and the existing layers, so consider this approach.

  • PowerCLI defining politics NTP to "Start and stop with the host" in ESXi 5

    Would appreciate any help in the definition of the strategy NTP on ESXi 5 hosts 'start and stop with the host. My script is currently using the following:

    Get-VMHost MyEsx | Get-VMHostService | where {$_.} Key - eq 'ntpd'} | Game-VMHostService-policy "automatic."

    This sets up the NTP service in "start automatically if all ports are open and stop when all ports are closed.

    "When I cange to 'MyEsx Get-VMHost | Get-VMHostService | where {$_.} Key - eq 'ntpd'} | Game-VMHostService-political ' market / stop with host"" the following is returned:

    «The possible enumeration values are "auto, On, Off«»»»

    Anyone know of a way (in PowerCLI) of the set up for the 'start and stop with host?

    OK, then you should choose politics "on".

    These are the policy values and what they match.

    Like this

    Get-VMHost MyEsx | Get-VMHostService | where {$_.Key -eq "ntpd"} | Set-VMHostService -Policy On
    
  • Script to start and STOP databases

    Hello

    I need a script to start and stop database.
    Well I tried with dbshut, dbstart oracle_home/bin, but has not tried to oracle_home_listener-exporter also worked.i but no luck.
    always on display the error oracle_home_listerner is not defined.

    I tried run as dbshut ORACLE_HOME, but it may take the listener down but no database.where am I missing.

    all other scripts to do this?

    Kind regards
    Naga.

    Have you seen this script?
    http://www.Oracle-base.com/articles/Linux/AutomatingDatabaseStartupAndShutdownOnLinux.php

    Aman...

  • I can't my auto signature to look how I want that she keeps returning to the text without spaces

    I can't my auto signature to look how I want that she keeps returning to the text without spaces

    Put

    < br >

    everywhere, you want a line break.

    for example

    My phone number is 01937 534183 if you wish to discuss. < br >
    < br >
    Thank you, < br >
    < br >
    Oliver

  • minimize the browser and automatically adjust the text

    Hello

    How can I reduce the browser and automatically adjust the text in Adobe Muse?

    I want to get the same effect as on this page:

    http://Bienz-photography.ch/

    on the departure site, there is the "Welcome" text and if I reduce the browser the text adjusts automatically.

    How can I do?

    Thanks for your help.

    What you re looking is delicate design which is not yet supported by Muse.

Maybe you are looking for

  • The message contains inappropriate language

    Your message contains profanity or inappropriate language. In the interest of your fellow forum users, we ask you to change your message. I got this message when I tried to post a perfectly clean question on this forum. There, can someone help me?

  • Hello world

    I have a wifi problem since a few days, when I start it shows me (Intel my wifi technology adapter not found If anyone here please help me HP PAVILION DV6 MODEL # 11BNHMW PRODUCT: LB552UAR #ABA SERIES: 3CFO5214KQ

  • I have a compaq presario cq62-417nr

    Can I free restore disk for my laptop?

  • Re: Deskjet 3070 printer stop printing black ink

    Same thing happened to me. Black print cartridge has just stopped printing all of a sudden. I changed it a couple times but without success. Tried the workarond provided by someone else in this thread (type of glossy paper, normal quality) and that s

  • The use of HTML5 to access a local database

    I'm working on an application that will need to access information from a database. I would like to inculde a database sqllite as part of my installation file and use html5 to search this database file and present the data in it to the user. Is it po