Find H1 style in Top of Frame only

Hi Everyone,
Request:
I want to find "H1" style in top of frame only. It is two column book.
If "H1" style comes in both the columns 1 and 2.
Problem:
Document using span columns, so the script will find all the  H1 style falls in first line of every column.
Trying script in  ways:
var myDoc = app.activeDocument
app.activeDocument.viewPreferences.horizontalMeasurementUnits = app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS;
var myTextFrame = myDoc.textFrames.everyItem().getElements()
for(i=0; i<myTextFrame.length; i++)
        if(parseInt(myTextFrame[i].geometricBounds[3] - myTextFrame[i].geometricBounds[1]) == 180)
    for(j=0; j<myTextFrame[i].textColumns.length; j++)
        if(myTextFrame[i].textColumns[j].lines[0].appliedParagraphStyle.name == "H1")
            alert("H1 in First line of Frame\n"+ "Contents:" + myTextFrame[i].textColumns[j].lines[0].contents + "Page number: " + myTextFrame[i].textColumns[j].lines[0].parentTextFrames[0].parentPage.name)
            app.select(myTextFrame[i].textColumns[j].lines[0].parentTextFrames[0])
            exit(0)
Could anyone please give solution.
Kindly check the screenshot
Thanks in advance
Beginner_x

Hi,
A solution could be to compare .endBaseline properties.
i.e.:
myTextFrame[i].textColumns[0].lines[0].endBaseline ==> this could be a base for textFrame [i]
so make the next if startement with two conditions:
- proper paraStyle
- proper endBaseline of 1st line of x textColumn (equal or "no higher then...")
rgds
Jarek

Similar Messages

  • Apply style at top of frame

    Hello all,
    I'm placing about 150 pages of continuous text from a Word doc.  The doc is being continually edited and each time I place it to create a draft,  there is a different placement of words, which is fine.  The page size is also different in Word and InDesign I should add.
    There is a Head B paragraph style in InDesign that is allowed to occur anywhere.
    The issue is that when the Head B occurs in the middle of a text frame, it needs to have a rule above it.  But when it lands at the top of a text frame, it CANNOT have a rule above it.  Is there anyway to use GREP or scripting or something to have InDesign identify when this style occurs at the top of the text frame, and have it use  the style without the rule?
    I can't assign this ahead of time  in Word as the layout is completely different once placed in InDesign.  And it's a bit of a pain to find them all and adjust by hand every time as there are about 40 of them.
    Thanks so much!

    Here is a script. You have to replace "Head B" on the first line with the original style and "Head C" on the second line with the style you want it to become if it is the first paragraph of the text frame.
    Save the script to your script panel folder then select some text of the story and run the script.
    This script doesn't have any error checking so you have to make sure you select text before running the script and the story can't have any overset text or it will through an error.
    var myOriginalStyle = app.activeDocument.paragraphStyles.item("Head B")
    var myFinalStyle = app.activeDocument.paragraphStyles.item("Head C")
    var myStory = app.selection[0].parentStory;
    var myP = myStory.paragraphs.everyItem().getElements();
    for(var j = myP.length -1;j>=0;j--){
        var myTF = myP.parentTextFrames[0];
        if(myP.appliedParagrahStyle = myOriginalStyle && myTF.paragraphs[0] == myP)
        myP.appliedParagrahStyle = myFinalStyle

  • How do I turn off the window maximizing feature when I click the top window frame?

    Clicking on the top window frame causes Firefox to maximize. This is the only program I have that does this, so I am constantly doing this accidentally. It causes me no end of annoyance, having to minimize the Firefox window every time to see the other window I am using at the same time. Is there a way of turning this "feature" off? I have looked through all controls tabs I can find, and the help files on the Firefox website, and can find no answers to this.

    Unintended consequences ... my favorite kind! New information - this appears to be a Windows issue - sorry Mozilla. Another app (Word) just started doing the same thing (previously only observed with Firefox). If the app is too close to the top of screen, and you select it, and slightly move it, it maximizes. I heard this is standard in Windows 7, but I am using XP. This is becoming typical of the annoying hubris of Microsoft that will likely make my next OS Linux. I am not blind, and in need of Microsoft making a single window maximally readable, especially at the expense of all the other windows. If I wanted my computer to make all of my decisions for me, I would have stuck with Apple!
    Sorry Mozilla help board - I just had to get it off my chest!

  • How to find Object Styles

    Hello,
    Adobes Scripting Guide: JavaScript explains well(more or less) how to find text, greps and glyph. But lacking is how to find Object Styles. The Find/Change Dialog box in ID does have this option.
    What I would like is a script that will find a style, then fill in the color of that style so that one can clearly see in a long document where the style was used. When there are only subtle differences between styles, this is helpful.
    The first thing to do is to clear all the options and that is my first stumbling block. In the following code the first line works, clearing the find of any parameters. The second line does not work.
    app.findObjectPreferences = NothingEnum.nothing;
    app.findChangeObjectOptions = NothingEnum.nothing;
    I also need to set the Search for Documents (not All Documents nor Selection) and to set the Type for All Frames.
    The second obstacle is setting the Find so that it will find the object I am looking for. The code below does not work but I do not know why.
    app.findObjectPreferences.getElements("Object Style 1");
    Any help is appreciated.
    Tom

    You need this:
    app.findObjectPreferences = null;
    app.findObjectPreferences.appliedObjectStyles = "Object Style 1";
    found_objects = app.activeDocument.findObject();
    Some things are different in scripting compared to the interface. For instance, the scope of the search in the interface is just "document" or "all documents", but in a script you can search a page, a spread, almost anything (I have to say that this is true for text and grep searches, I never tried it for objects). Finding frame types is different as well: there's no parameter for that I don't think. Instead, you have to find all frames that have a particular object style applied to them, then cycle through them checking their frame type; if the type matches your criteria, do what you want with it.
    Peter

  • Hi, i have tryed to install os x leopard, (its a old imac) , disk utility is greyed out , my install dvd cant find any hdd to install on , my only way to format and configure is through terminal but dont know what commands to execute

    hi, i have tryed to install os x leopard, (its a old imac) , disk utility is greyed out , my install dvd cant find any hdd to install on , my only way to format and configure is through terminal but dont know what commands to execute...
    i tryed diffrent commands such as diskutil eraseDisk JHFS+ Disk1
    diskutil list , wont show up my harddrive , i now its functionally cause it shows up in disk utility with name and i can get info about it , but everything is greyed out can only switch between "erase , partition , recover , Raid ,....
    when i click the apple in the top left corner the whole menu is greyed out... what to do ?  help me please
    Sincerly AppleNoob92
    p.s i have no experience in apple imac's at all never used before, but im kinda windows nerd so computers i understand but this imac make my insane, cant seem to find any solutions anywhere on the WWW....

    Your HD may be crashed, so you probably should use the oringinal install discs to run Apple Hardware Test in extended mode. If error codes appear this confirms a hardware failure. In addition you cannnot repair the HD using Disk Utility from the startup disk, you have to use the origninal Install discs that shipped with the computer or the most up-to-date version of OS X on a disc that you have.

  • Can I set a default finder window style?

    I would like to set a default Finder window style that will affect all windows, new and old. I am able to set my default style to list, but I want to go beyond that. I want my windows to be lists, with only certain columns visible, I want the columns to be set to specific widths, and I want the windows to open as if the green button in the corner had been pressed.
    In Windows it is fairly easy to set a default Explorer window style with this level of setting. Can I do it on my Mac? Some setting I am missing, or some third party program?
    Thanks!

    boombass wrote:
    I tried your command, and after a while the Terminal window gets hung up on:
    find: /dev/fd/3: Not a directory
    find: /dev/fd/4: Not a directory
    Just two of many that you shouldn't be worried about. These will reveal everything I know about them:
    ls -al /dev/
    ls -al /dev/fd/
    I haven't a clue why running this is hanging up on your machine:
    sudo find / -name ".DS_Store"  -exec rm {} \;
    As for why you're you're still having issues after setting up the initial folder, I haven't a clue, since it worked here when I had an issue with it.

  • How to give Bold style inside Single Text Frame

    Hi
    I created a text frame with some text in it. It comes in three paragraphs. First para is the title with two words and below two are small description. All the text is kept in single textframe and I need that to be in single frame only. NOW, I need to bold the first para that is the title with two words. How can I write the code to give bold style to the first paragraph inside that frame? Do I need to take different frame? I want all in single actually. Also I want the entire text frame to give my customized text color.
    Hoping a valuable suggestion
    Thanks in advance.
    Regards
    P

    Dave, Good questions(s)!!! Details below...
    It's CS2. I need to put some text in all (many) documents I work regularly. Instead of copying from the previous file or any other source, as the text is same for all, I thought of writing the script with the text itself. Running that will create text frame and write the text. Got almost but was unable to bold the title of the text which I mentioned earlier as a first paragraph with two words.
    Also I couldn't give the my color swatch to the text.
    Here is my script:
    var myTextFrame = app.activeWindow.activePage.textFrames.add()
    var myParagraph = myTextFrame.paragraphs.item(0)
    var myFont = app.fonts.item("Arial")
    myTextFrame.geometricBounds = ["11.2in", "6in","9.57in","0.5in"];
    myTextFrame.contents = "First Paragraph"
    myTextFrame.parentStory.insertionPoints.item(-1).contents = "\r This is Second paragraph.";
    myTextFrame.parentStory.insertionPoints.item(-2).contents = "\r\rHere comes the Third Paragraph with extra para space";
    myParagraph.parentStory.appliedFont = myFont
    myParagraph.parentStory.pointSize = 8
    myParagraph.paragraphs.item(-1).spaceAfter = "0.05in"
    myTextFrame.fit(FitOptions.frameToContent)
    Hope this answers all your questions. Waiting for valuable solution. Have another question will ask after I got this. For now, two questions 1) making bold first two words 2) font color

  • Dropped frames only on xserve raid

    dropped frames only on xserve raid
    i'm not able to capture on xserve raid without dropped frames. tihis was a working sytem bud one morning it dosn't work. i capture on mac pro internal drives or external fw drives without problems.
    the xserve raid is new formated in raid level5 [mac os extended journaled and striped in raid 0 extended] and the risult of kona system test are 178mb/sec write and 167mb/sec read.
    must bee enought for 8bit uncompressed pal, no? also if i divide the stripe set the system dosn't work on both controler. i tried also to change the fibrechannel cables!
    i checked also the fibrechannel card with expansion slot utility and the message is that runns at maximum speed.
    there are no error message on raid admin, the xserve raid appears ok.
    i'm shure that the fcp settings are ok, i know the list that regard dropped frames from apple.
    i'm desperate, can you help?
    thanks jochen
    system:
    mac pro 2x3ghz-5gb ram(from apple and the hardware test on the system dvd is ok)
    osx 10.4.10
    fibre channel card: lsilogic firmware 1.2.18.0 in slot 4
    xserve raid 15x250gb firmware 1.5.1/ 151c
    aja io (driver 3.0)
    raid admin 1.5.1 (diver 1.0)
    fcp 5.1.4

    I'm guessing conditioning is the same as optimization, but I can't find anything about it in the help documentation. I ran another capture test today with no problems.
    An interesting side event is that when I started experiencing dropped frames I ran the Kona System Test utility to verify write and read speeds. It wouldn't run (no write or read) on my RAID. I tried it on my Firewire drives with no problems. I discovered that in the Kona System Test preferences there is a choice of I/O API for Macintosh or Unix. When switching to the Unix I/O API the test ran fine with expected read and write speeds reported. I've used the Kona utility in the past without having to change that setting. I sent an inquiry to AJA.

  • I think I am having shutter issues with my 5D mark iii. image is vignetting on top of frame.

    I think I am having shutter issues with my 5D mark iii. image is vignetting on top of frame. ( left side when shooting portrait).
    does not happen all the time. shoot 20 frames, not a problem then will happen 4 or 5 in a row or every other shot for a few shots.
    Studio situation with 4 lights but it is not a light issue. subject is dark also. all lights fire at full.  happens weather at 1/100 or down to 1/20. these 4 examples were shot at 1/50  f 10 iso 100. raw converted to jpeg. shooting teathered but I dont think that matters. has anyone else had shutter issues? can any one from canon give me any info or help??

    It may be that the flash is firing as the shutter is opening... but if you're having an issue with a sticking shutter, the shutter isn't completely open when the flash fires.  
    If this is the case then it wouldn't matter how long the shutter is open because the flash doesn't provide light continuously when the shutter is open... it only gives a burst.  That momentary burst is normally fired at the moment the shutter finishes opening up completely (but if the shutter is sticky and isn't completely finished opening when the flash fires... you'd have a dark edge.)
    If you used 2nd curtain shutter so that it doesn't fire until the moment before the shutter is intended to close, you shouldn't see vignetting even if the shutter is sticking.
    But this makes me wonder what the shutter count is on your body and if it needs service.
    Tim Campbell
    5D II, 5D III, 60Da

  • I frame only 4:2:2 encoding settings?

    Hi
    Can someone please tell me the AME setting to create an MPEG-2 Program Stream with the following specs?
    625/50 PAL
    Video Size: 720 x 576
    50 Mbps CBR I frame only
    Profile: 422P@ML
    Colour Sampling: 4:2:2
    Many thanks
    Riz
    PS. FYI, these are the SD (PAL) video specs for AdStream UK digital delivery service.

    Thank you for the MediaInfo tip.
    I have downloaded and run the file I created. Details are below but I am not sure where I should read 'I-Frame Only'? The entire broadcast industry uses that term but for some reason neither Adobe nor MediaInfo mentions anything about it? Also, how can I produce 4:2:2 instead of 4:2:0 as I produced?
    Video
    ID                                       : 224 (0xE0)
    Format                                   : MPEG Video
    Format version                           : Version 2
    Format profile                           : Main@High
    Format settings, BVOP                    : No
    Format settings, Matrix                  : Default
    Format settings, GOP                     : N=1
    Duration                                 : 1mn 20s
    Bit rate                                 : 50.0 Mbps
    Width                                    : 720 pixels
    Height                                   : 576 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 25.000 fps
    Standard                                 : PAL
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Interlaced
    Scan order                               : Top Field First
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 4.823
    Time code of first frame                 : 00:00:00:00
    Time code source                         : Group of pictures header
    Stream size                              : 478 MiB (97%)
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709
    All help is appeciated.

  • Trying to change ownership of my old iPod. The advice here is to go to "Devices" "Summary" "Restore", but I find "Devices" does not offer "Restore" but only "Sync", "Transfer", "Backup", and a greyed "Restore from backup."

    Trying to change ownership of my old iPod. The advice here is to go to "Devices">"Summary">"Restore", but I find "Devices" does not offer "Restore" but only "Sync", "Transfer", "Backup", and a greyed "Restore from backup."

    What I don't understand is that your iTunes looks different from mine--just a little bit. You have 3 circles, red, yellow, and green, in the upper right end of the top bar. INstead I have a square that is half gray. When I click it, I get a menu very similar to the menu under "File."
    The only place I see an entry for "Devices" is under "File," but it only gives the 4 options I mentioned before (see below). There is no "Summary."
    Here's another screen shot after I added an album to music. Now all the choices under "Devices" are grayed.

  • How to find different styles from Indesign CS4 Grap style?*

    Hi,
    I would like to know how to find two different character style from a single grap command in Indesign CS4.
    For instance, A word having bold/italic character style following with punctuation having normal/none character style.
    Thanks for your help!
    Regards,
    Bharat

    With GREP styles you can search text only, not formatting.
    Peter

  • 50 MB constant bit rate I Frame only MPEG-2 Program

    '50 MB constant bit rate I Frame only MPEG-2 Program'
    What does that all mean, and how do I go about to find all these settings?
    It's for a commercial.
    Niel

    You're going to have a much easier time doing this in Compressor 3 than in 2, but what I'm assuming you're talking about here is a Program stream (multiplexed file) very similar to a transport stream.
    These MPEG-2 encoded files are used for broadcast and have both the audio and video contained in one file as opposed to DVD which requires those assets separated into elementary streams.
    If you're using Compressor 2, create a custom MPEG-2 setting and in the extras tab of the Encoder Pane select the Multiplexed option. Note though, that you will only be able to take the bit rate up to 20Mbps and it will only create a transport stream.
    In Compressor 3 you can choose between Program and Transport streams and you can increase the bit rate up to 40Mbps.
    BG

  • I bought photoshop elements 8 a few years ago. I had to reinstall my computer, and I can't find this PSE 8 on Adobe. Only the 12 is available, but I've paid a serial for the 8. Can you help me please ?

    I bought photoshop elements 8 a few years ago. I had to reinstall my computer, and I can't find this PSE 8 on Adobe. Only the 12 is available, but I've paid a serial for the 8. Can you help me please ?

    Download Photoshop Elements products | 9, 8, 7
    Mylenium

  • Find/replace styles in Pages 5

    In Pages '09, one can find a style, under the "Advanced" menu in the find/replace pop-up.  I use this to prepare talks, writing my own comments in a different style than what I'll print and hand out.  Thus, I find the style and replace it (with nothing), and be left with simply the text for the handout.  Is there a way to use find/replace in Pages 5 to search and find a particular style?  I can't find it.  Thank you!

    That is an extremely useful feature. I just was using that on a document to hand last night, searching on an expression and applying a style to it, Saved me hours of work. Not something Apple seems to get these days.
    Nobody apparently is supposed to work on Macs anymore, just fiddle.
    Viking is being modest, the count is over 110 known missing features and countless bugs or things that simply don't work as they are supposed to.
    Thankfully there is still Pages '09! For now. Which should still be in your Applications/iWork folder.
    Peter

Maybe you are looking for