Find spaces greater than particular width value

Dear All,
Requirement:
In InDesign Scripting, is it possible to  straightly find spaces whose width is greater than particular value (e.g. 4 pts) to speedup a task.
Currently we are finding most of the spaces and calculating their width as like below (i.e subtracting horizontal Offset value from end Horizontal Offset value) that is consuming more time.
====================================================================================
Trying Script Code:
myWidth=mySpace.endHorizontalOffset - mySpace.horizontalOffset;
====================================================================================
Please advise.
Thanks,
Rajesh

You can use a approach like this:
1) grab myText.characters.everyItem().horizontalOffset. This will give you an array of every horizontal offset in your text.
2) Grab myText.contents which will give you a string of all your text.
3) Search your string for spaces and check the first array for the horizontalOffsets surrounding the space.
This will allow you to do the check with only two DOM interactions and it should be very fast iterating over the string and array.

Similar Messages

  • How to find greater than for 2 values and post greater value in new cell

    I'm trying to compose a formula for a cell whereby the answer is the greater of 2 other cells.i.e. e4 and f4 are the reference cells and g4 should have the greater of the 2 values as the answer in that cell. Should be simple but cannot figure it out. Thanks to the geniuses out there

    =Max(e4,f4)
    see page 254 of the Formulas and Function User Guide.

  • Available disk space greater than capacity?

    I'm new to this whole mac thing, and maybe I'm overlooking something....but this just doesn't seem right.  If I click on the hard disk of my new 13" MBA 256G, and choose get info, I get the following:
    Capacity: 250.14GB
    Available: 296.42GB
    How the heck does Lion think that I have more free space than the drive can even hold?

    I would suggest booting from the Recovery Partition and repairing the disk with Disk Utility from there.
    I have seen disks that report no errors when verified only to have errors corrected when repaired. In fact I hardly ever use verify for just that reason. I prefer to just be done with it and do a repiar in the first place.
    Allan

  • ORA-22926: specified trim length is greater than current LOB value's length

    I am getting an ORA-22926 when passing a clob to the REPLACE function in 11gR2. I found this comment from someone else who experienced this:
    1. Identified the issue as the replace function that works on Oracle 10gR2, but not on 11g for the CLOB of some
    of the xml files for some character setting in the Oracle database.
    2. Submitted a service ticket to Oracle.
    3. Oracle provided a workaround solution.
    4. Implemented the Oracle workaround solution.
    Here is the link:
    http://www.alfred.edu/banner/docs/general84S1_release.pdf
    Does anyone know the workaround for this?
    Thanks

    I found a work around for this issue. REGEXP_REPLACE works as it should for clobs in 11g, so if you get ORA-22926 using the REPLACE function, try using REGEXP_REPLACE.

  • [10g] Way to find least value greater than a value?

    I have a simple (I think) question ...
    Part 1:
    Is there a way to determine the least value, among a set of values, that is greater than 0?
    A couple of examples:
    Set of values:
    {0,1,2,3}
    Return value:
    1
    Set of values:
    {0,5,10,20,100}
    Return value:
    5
    Set of values:
    {1,4,9,11}
    Return value:
    1Part 2:
    Same thing, but greater than some given value, not necessary 0.
    Set of values:
    {0,1,2,3}
    Parameter value:
    2
    Return value:
    3
    Set of values:
    {0,5,10,20,100}
    Parameter value:
    2
    Return value:
    5
    Set of values:
    {1,4,9,11}
    Parameter value:
    2
    Return value:
    4In particular, I'm looking for an efficient way of doing this. I believe I can do it with a set of CASE statements, but it gets really complex the more values you are comparing.
    My first thought was to use the LEAST function, but that doesn't allow me a way to use a parameter.
    Any suggestions?

    -- this section has been edited
    And that's basically where I was heading. I was hoping there was a less complex way to do it... somehow replacing any zeros with an impossibly large number, without using case statements (something equivalent to the NVL function, but to replace any value with another), so that they'd never be less than anything, and then I could just use the LEAST function. The only way I can think of to do that though, would be to convert the numbers to strings, use REPLACE, and then convert them back to numbers, which doesn't seem less complex than the CASE statements, and most likely is worse performance-wise.
    For example:
    SELECT     ord_nbr
    ,     seq_nbr
    ,     time_spent /
         CASE     WHEN     comp_qty     <= plan_qty
              AND     comp_qty     <> 0
              THEN     comp_qty
              WHEN     comp_qty     > plan_qty
              THEN     LEAST     ( TO_NUMBER(REPLACE(TO_CHAR(ord_qty-scrap_qty),'0','999999999'))
                        , TO_NUMBER(REPLACE(TO_CHAR(plan_qty),'0','999999999'))
                        , TO_NUMBER(REPLACE(TO_CHAR(comp_qty),'0','999999999'))
              ELSE 1
         END     AS unit_time
    FROM     ord_detail
    ;-- end of section edited (I posted before I had fully gone through the solution provided)
    I checked the data, and though, theoretically all values could be zero, there are no instances where that happens. I think that, in the case all values were 0, I'd just want to use 1 instead.
    Side note on the "big" problem behind this question....
    My ultimate problem, (and if I end up needing help with that, I'll start a new post for it) is that the quantity data in our system has a fair amount of junk in it...values that can't be true. With this solution, I would assume that in any case where the quantity complete at a given step of a process is less than or equal to the quantity planned to be complete at that step, the value is good, which is not necessarily a correct assumption. Then, only in cases where something can't be true, like when quantity complete > the quantity planned, are when I would intervene with this solution to make a "best guess" at the correct value. There a few things related to this that I have to determine before I can figure out my next step.
    We have another database (so we can keep things straight, I'll call the database I've been querying up til now DB1, and this other one, DB2) that has much more reliable quantity data and step data (sometimes it has steps that aren't in DB1) but its structure is complex, I'm rather unfamiliar with it, and it does not have time spent data. Additionally, some products have all their information in DB1, and none in DB2.
    So my options are to:
    1) ...try to learn the structure of the other database, find the data I need, and query both databases together, using this thread's solution to resolve any questionable data that does not exist in both systems, and skipping any steps that occur in DB2, but not DB1 (since they won't have any time data, which is ultimately what I'm after)
    2) ...try to come up with a method to pre-"scrub" my data in DB1, based on some logical assumptions and looking at all steps in an order, so that I can then just query the scrubbed data...
    3) ...use the solution from this thread, and assume that the bad data isn't enough to significantly impact my calculations...
    What I wouldn't give for a single system with all good data!
    Edited by: user11033437 on Nov 19, 2010 4:21 PM

  • ESS Claims - Requested value Rs. 20000 is greater than balance eligibility

    Dear All,
    While Approving the ESS claims request getting a error message Requested value Rs. 20000 is greater than balance eligibility value 0.00.
    Help in solving this issue.
    Regards,
    Potru.

    Hi,
    This is a correct error. Please check the balance amount in infty 45 for the particular loan type. The loan request should not exceed that.
    Hope this helps
    Regards
    Roy

  • How to prevent numericstepper from setting the value to the defined Maximum when a number greater than maximum is entered in by keyboard and user hits the "Enter" key.

    I need to set the Maximum so that the use can use the mouse to change the value of numericstepper (and not go over a certain number), but at the same time I have to allow the user to enter their value by typing in the text field. When the user enters a number greater than the Maximum, I disable the "Ok" button of the dialog and show a red warning(error message). The issue is that the user can hit "Enter" and numeric stepper would set the value to the Maximum and the dialog box would close and the rest of code would run. I want the numericstepper not to change the value and keep showing the warning even if the user hits the "Enter".
    Note: Setting maxChar does not help since my maximum is 1000, and user might enter 5555
    I would appreciate the help.

    Thanks for trying to help, But
    The issue is that if I set the maximum value of stepper 1 greater than the max value that I want, then the user can select an invalid value(of myMax + 1) when he clicks on the UP arrow of the numeric stepper(which is not acceptable for what I am working on).
    I need to preserve the users invalid number, while not letting the user to select an invalid number by clicking UP key.
    I noticed that when the user enters a number greater than the Maximum, and then click on the down arrow, it would set the value to 1 less than the maximum. This is not acceptable either.

  • How do I disallow negative numbers in a selected group of cells (i.e. only allow values greater than or equal to zero)?

    I have a table of calculated values in Numbers, and I want to disallow negative numbers in the entire table. Any numbers that would be negative I would like changed to/displayed as zeroes, that way future calculations that may be based on this cell use the value of 0 for the calculation rather than the negative value. I have seen ways of doing this to single cells at a time, but I am interested in applying it to a large selection of cells.
    There is the Conditional Format option when you bring up the inspector, but I cannot get a custom rule to work for me. I select "Greater than or equal to" and I enter 0 in the box, but nothing changes. Can anyone help with this?
    Thanks

    A step toward simplifying the application of MAX to the issue, Jerry.
    This part, though:
    Now apply your long, animal-modeling, expressions to this new, interposing, table rather than the original.
    may still leave several references to be change from the original data table to the new one.
    One way to get around that is to use the Duplicate ("DATA-1) as the new table for raw data, and the Original (DATA) as the interposing table, using the formula =MAX(DATA-1::A2) as above, starting in DATA::A2.
    This way, the long expressions could continue to reference the original table (with its content now modified).
    ALTERNATE process:
    Find/Replace could also be used to speed the process of reassigning the modeling expressions to the duplicate table, as suggested by Jerry. But some cautions apply here.
    Find/Replace can be limited to Formulas only, but not to Some formulas only.
    Find/Replace can be limited to the Current Sheet only, but this can't be combined with Formulas only.
    More on this later, when I've had a chance to check some possibilities.
    Regards,
    Barry

  • Post park ivoice M8079 'Reversal value greater than value invoiced to date'

    I create a Service purchase order number is 8200000747 in our products system, and service entry sheet number is 1000026152, material document number is 5000306476.
    When I create a park invoice reference this Service PO, the system can not clear GR/IR account with that service entry sheet(1000026152). When we want to post this park invoice, system generate message M8079 'Reversal value greater than value invoiced to date'. But, this item never been verification invoice , I can find this not cleared  GR/IR data in MR11, this item not a multi account assignment , no foreign currency.
    What happened? How can I carry out the correct GR/IR account data in park invoice?

    Hello,
    Instead of reversing the invoice try posting the Credit Memo through MIRO .
    Regards
    Mahesh

  • Change "to equal" to "to be greater than" in Wait for Field to equal Value"

    In Sharepoint Designer 2010, in the workflow Action "Wait for Field to equal Value", I could change the "to equal" to "to be greater than". I can't find how to do this in SPD 2013.
    Can someone please help?
    Thank you!

    Hi
    PieterVanHeerden, is a big problem that gives us the change Microsoft . An option to mitigate this problem could be to use an additional workflow that runs whenever the item is updated . Workflow evaluate the condition that you need and when it is Ok, updates
    the value of a field used as flag called eg " Control_Hora_Inicio_Completo " with " true " value.
    In your current workflow you should modify the condition for the WorkflowF stops until the Control_Hora_Inicio_Completo field equal to " True " when it meets the Workflow continue and you're sure you have entered a value , whatever that is .
    I hope you can try and you work.
    Greetings from Argentina .
    Maxi
    Msorli

  • Export error: value of length column (38) greater than VARDATA column (36)

    Hello @,
    I am performing an export on HP-UX/Oracle of a R/3 Enterprise 1.10 system.
    I already use got the latest R3load binary. For pool table KAPOL I get
    this strange error and I couldn't find any further information about it:
    cat SAPPOOL.log
    (EXP) TABLE: "DEBI"
    (EXP) TABLE: "DVPOOL"
    (EXP) TABLE: "DVPOOLTEXT"
    (EXP) TABLE: "FINPL"
    (EXP) TABLE: "GLTP"
    (EXP) TABLE: "KALK"
    value of length column (38) greater than VARDATA column (36)
    (CNVPOOL) conversion failed for row 356 of table A004       VARKEY = 001V ZSP0003010TI060067A.01      00000000 
    (CNV) ERROR: data conversion failed.  rc = 2
    (DB) INFO: disconnected from DB
    /usr/sap/AVT/SYS/exe/run/R3load: job finished with 1 error(s)
    /usr/sap/AVT/SYS/exe/run/R3load: END OF LOG: 20110117114148
    SQL> desc kapol
    Name                                      Null?    Type
    TABNAME                                   NOT NULL VARCHAR2(30)
    VARKEY                                    NOT NULL VARCHAR2(195)
    DATALN                                    NOT NULL NUMBER(5)
    VARDATA                                            RAW(36)
    SQL> select length(vardata),count(*) from kapol group by length(vardata);
    LENGTH(VARDATA)   COUNT(*)
                 72     183681
    select dataln,count(*) from kapol  group by dataln;
        DATALN   COUNT(*)
        -32730          2
            36     183679
    Does this mean that one row in KAPOL has to be changed from within SAP?
    Or could it be an error/bug within R3load?
    Regards,
    Mark
    Edited by: Mark Foerster on Jan 17, 2011 12:46 PM

    Maybe this information is of any help:
    I opened a support call and was told by SAP support to change the
    two entries from -32730 to -32732. Don't ask me why...

  • How to make the width of powershell script's output greater than 80 column?

    Hi,
    I am trying to remotely execute a powershell script through ssh, and I found the output of my script is only 80 width, a carriage-return and a line-feed are inserted after 79th column, and continue presenting the 80th value of each row onto another line.
    I want it greater than 80, such as 512.
    The code to print the output in my script is like:
    $allInfo | ConvertTo-Xml -as Stream -NoTypeInformation -Depth 1
    Any help will be really appreciated!

    But when I run the powershell script manually, I get the following error message, I do not know why, but anyway, my problem is resolved.
    Exception setting "BufferSize": "Cannot set the buffer size because the size specified is too large or too small.           
    Parameter name: value                                                                                                       
    Actual value was 512,25."                                                                                                   
    At C:\Users\qzhang\Documents\GetVM.ps1:30 char:16                                                                           
    + $Host.UI.RawUI. <<<< BufferSize = New-Object Management.Automation.Host.Size (512, 25)                                    
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException                                                    
        + FullyQualifiedErrorId : PropertyAssignmentException  
    Yeah, that's a good question.  I get the same thing here.  The longer solution the post covers which I've included below does work interactively, and looking at the differences it appears to be related to the buffer height.  My guess is when
    the existing console window already has more rows in the buffer than the 25 rows in height the command tries to define, this error occurs.
    if( $Host -and $Host.UI -and $Host.UI.RawUI ) {
    $rawUI = $Host.UI.RawUI
    $oldSize = $rawUI.BufferSize
    $typeName = $oldSize.GetType( ).FullName
    $newSize = New-Object $typeName (500, $oldSize.Height)
    $rawUI.BufferSize = $newSize

  • Auto adjustment of page orientation causes printing issues with documents that have a page width greater than its page height.

    Hi,
    Since an upgrade from Word 2003 to Word 2010, we are experiencing printing issues with certain
    documents that have a page width greater than its page height.
    In Word 2003, it was no problem to set the page width greater than the page height while setting the page orientation to "portrait".
    In Word 2010, this seems impossible: despite leaving the page orientation to "portrait", if one changes the page width/height as stated,
    Word 2010 automatically adjusts the orientation to "landscape". Resetting the orientation to "portrait" will flip the page's width/heigth settings.
    This behaviour causes printing problems: the page prints out 90° rotated.
    I do not believe this is a printer driver issue: I tried several different printer drivers, and all give the same (bad) result. Setting the printer driver's page orientation settings (before printing) makes no difference, as
    Word 2010 seems to force the page orientation settings.
    Inserting the documents 90° rotated is not an option, since it causes problems with the printing margins.
    This is very annoying, since we have to print official documents of a municipality (driver's licences).
    Is there a workaround for this issue?
    Regards,
    Laurent Grandgaignage
    Sysadmin Gemeentebestuur Stabroek, Belgium

    Hi
    Thank you for using
    Microsoft Office for IT Professionals Forums.
    From your description, we can follow these steps to test this issue
    Step 1: Repair Office 2010
    1.      
    Click
    Start, and then click Control Panel.
    2.      
    Click
    Programs and Features.
    3.      
    Click the
    Office 2010 program that you want to repair, and then click
    Change.
    4.      
    Click
    Repair, and then click Continue. You might need to restart your computer after the repair is complete.
    Step 2:
    Rename the global template (Normal.dotm)Follow the steps for the operating system that you are using:
    Windows Vista and Windows 7
    a)      
    Exit Word 2010
    b)      
    Click
    Start.
    c)       
    In the
    Start Search box, type the following text, and then press
    ENTER:
    1.      
    %userprofile%\appdata\roaming\microsoft\templates
    d)      
    Right-click
    Normal.dotm, and then click Rename.
    e)      
    Type
    Oldword.old, and then press ENTER.
    Microsoft Windows XP
    a)      
    Exit Word 2010
    b)      
    Click
    Start, and then click Run.
    c)       
    In the
    Open box, type the following text, and then press ENTER:
    %userprofile%\Application Data\Microsoft\Templates
    d)      
    Right-click
    Normal.dotm, and then click Rename.
    e)      
    Type
    Oldword.old, and then press ENTER.
    f)       
    Close Windows Explorer.
    How to troubleshoot print failures in Word 2010, Word 2007, and Word 2003
    http://support.microsoft.com/kb/826845
    Please take your time to try the suggestions and let me know the results at your earliest convenience. If anything is unclear or if there is anything
    I can do for you, please feel free to let me know.
    Hope that helps.
    Sincerely
    William Zhou CHNPlease remember to mark the replies as answers if they help and unmark them if they provide no help.

  • A message "Value in "Discount %" field is greater than permitted"

    Hi Experts,
          A message "Value in "Discount %" field is greater than permitted" will appear when adding an Issue for Production in production..

    Hi Karthick,
    Check Discount Limit for User
    Administration-System Initialization-Authorization-General Authorization
    and check Max Discount Limit
    Regards,
    Sandeep kr.

  • How do I make a text box solid if the value in the field is greater than 0 and do this for all recor

    Hello,
    I have several text boxes on a document, and wish to make the boxes either solid or visible if the value in the field is greater than 0.
    I am using an excel file for the data, each cell with either 1 or 0 (true or false).
    Any help would be appreciated.
    Thanks,
    BJ

    Yes, I also sent an email regarding this problem.
    I am using XNET to write a custom device for PXI-8516 LIN card.
    I've attached a couple snippets showing where I've tracked the problem.
    The only error that I've seen comes from the XNET Wait vi in the timeout snippet.  I believe that error occurs because frame queued in the write snippet is never transmitted by the LIN card.
    Attachments:
    Timeout_Error_Snippet.png ‏22 KB
    XNET_Write_Snippet.png ‏24 KB

Maybe you are looking for

  • XML Content and Linked containers

    Hi, I just downloaded the trial of CS5 and I was wondering how to do the following. I have 5 XML files that load into my site.  Each one is called by a button click.  On the initial stage I have 2 containers which are linked for overflow text.  So he

  • Which is best Cooler out of these 3?

    Hi ppl. Am wonderin as I am not a AMD guy. Which of these coolers is the best cooler and the quietest. Also will they all fit the MSI KT4V-L motherboard The coolers: Thermaltake Silent Boost  - heard it was huge n might not fit http://overclock.co.uk

  • Simple signal comparison problems

    hi i am tying to do a simple singnal comparison. eventually i want to read in two square wave signals 0-5v signals from my usb6008 DAQ Card But for now i want to Get the simulated wavforms amplitudes, then decide which is bigger. and light up the cor

  • Common follow-up task for multiple lead transaction types

    Hi Gurus, Happy New Year. I am creating 3 lead transaction types as per the business requirement and i want to use common lead follow-up task for all three Lead transaction types.  My question over here is what are the problems if i use common follow

  • Filtering the contents of one alv based on another ALV's filter

    Hi, I have used a tab element within which i have two tabs.each tab has an alv table. Is it possible to restrict the entries of one alv table based on enrties from another alv table(both the alv tables will have some common fields).for example I have