Setting grouped paragraph style with app.findTextPreferences.properties

I am trying to set my app.findTextPreferences using the .properties object...  In particular, I need to set the appliedParagraphStyle property.
So I create an object like this:
{findWhat:"some text", appliedParagraphStyle:"ParagraphStyleX"}
but it does not work because "ParagraphStyleX" is in a Group....  I have tried "GroupX:ParagraphStyleX", "ParagraphStyleX(GroupX)" and everything else I can think of....  but have not been able to get it to work.
Does anyone know the proper form to use?
Thank you,

try
appliedParagraphStyle:myDoc.paragraphStyleGroups.itemByName("theGroupName").paragraphs.ite mByName("paraName")
where myDoc is a ref to active doc.

Similar Messages

  • AppleScript Pages: How to set "following paragraph style"?

    How do you set "following paragraph style" for paragraphs or paragraph styles using AppleScript?
    I've tried several approaches, and all cause a run-time gag with the netorious error -10000
    More generically, what is the syntax for changing a property of a paragraph style that was user created?
    TIA!

    JonRKibler wrote:
    How do you set "following paragraph style" for paragraphs
    Here's an example that changes the following paragraph style of the first four paragraphs :
    tell application "Pages" to tell front document
          set following paragraph style of paragraphs 1 thru 4 to paragraph style "Heading 1"
    end tell
    JonRKibler wrote:
    How do you set "following paragraph style" for paragraph styles using AppleScript?
    Here's an example that changes the following paragraph style  of the paragraph style "Heading 1" :
    tell application "Pages" to tell front document
          set following paragraph style of paragraph style "Heading 1" to paragraph style "Heading 2"
    end tell
    JonRKibler wrote:
    More generically, what is the syntax for changing a property of a paragraph style that was user created?
    If you know the name of the style, here's an example that changes the value of the space before :
    tell application "Pages" to tell front document
          set space before of paragraph style "xyz" to 14
    end tell

  • Setting default paragraph style (InDesign CS4, AppleScript)

    I'm trying to set the default paragraph style to [Basic Paragraph], but this produces an error.
    Setting other styles does work, what's wrong with "[Basic Paragraph]"?
    tell application "Adobe InDesign CS4"
    tell active document
    tell text defaults
    set applied paragraph style to "[Basic Paragraph]"
    end tell
    end tell
    end tell
    Thanks,
    Peter

    Alternatively you could use:
                                  set applied character style of text defaults to character style 1
                                  set applied paragraph style of text defaults to paragraph style 1
    Cheers
    Tobias

  • How to replace a paragraph style with object style

    Hi,
    I am having this issue lately that in paginating a newspaper I have to do all premium post with a Rectangle Border. the problem is that the text is in the grid.
    Is there anyway that, while I add a specific paragraph style to some parts of the text, I can automatically give this text a specific Object Style (like stroke rectangle)
    Does it make sense?
    Thank you very much

    Michael,
    I think that I did not explain myself as I should have. The problem is not really related to links but more of a automatic replacement issue.
    Every time I do this newspaper I include a new text information and the location of the Headers changes in every single case.
    http://i.imgur.com/sgQ2wIK.jpg
    In the link, the blue paragraphs need to be replaced with the respective Header Icons that you see on top and everytime this location of the headers in the newspaper changes due to the different number of posts in each specific category. Now the problem is related on how to autoaticaly replace this string in blue with its respective header
    thanks a lot in advace for all your help

  • Setting up 20+ ipads with Apps on them and...

    Here is what I am trying to accomplish:
    Set up 20+ iPads with several (free and paid) applications, andmultiple PDF’s in the library.  Theuser will then be able to download as many apps as he/she wants, with his/herown itunes account.
    I was thinking of setting up all of the iPads with the same iTunes account todownload all of the base apps.. but then when the user goes to sync it tohis/her computer, it won’t work because you can only sync that iTunes accountto 5 computers, right?
    The ultimate goal would be to be able to download additionalapps to a users iPad with a company iTunes account if they can show that theapp is work related.
    I was also thinking of using the iPhone configurationutility.. but I can’t seem to figure out a way to do that with putting the appson there.
    Can anyone give me some advice on the best way to do this?

    iOS5 + iCloud might be the answer after all, if you are not looking at sync with USB cables to physical terminals.
    http://www.apple.com/icloud/what-is.html
    Let's just have to wait until this fall for a better picture

  • Applescripting properties within paragraph style (ID CS3)

    I have as script which creates a new paragraph style - nice, but would like to be able to set it up to include fonts, colors, tabs, indents, etc... any ideas?

    You can either wet them as you create it -- make new paragraph style with properties {fill color: someColorRef, ...} -- or make the style and then set its properties.

  • Create automatic white gap/bar with paragraph style

    Hello,
    Thanks to your help and the Paragraph Ruler trick, I managed to get automatic title formatting (the grey background)
    Now, I would like to get automatically white gap as in line two but I can't figure out how to do it (tried with strikethrough but it's all over the text, you can't cheat).
    Any idea?
    Thanks.

    Here I am (sorry I didn't answer before, during the weekend i am not in my office).
    You didn't tell us why do you want to change the text box width? That could help us to give you a better answer.
    However if you need to have different text box width you can use this method:
    Only one paragraph style with only one rule column width, "vertical line" and grep style.
    Below one example:

  • Using "Next style" with the same paragraph style for more than one paragraph

    Hi.
    I have been using paragraph styles with the "next style" option, it's a huge help. But I need a bit more. So I have the following paragraph structure: ABCCCABCCCAB...
    I defined paragraph styles for each kind of paragraph, then in paragraph style A, I added paragraph style B as the next style, and so on. However, when I get to paragraph style C I reach a dilemma. Should I define the next style as the same, or define three paragraph C styles (C1, C2 and C3), link them to each other with next style, and then loop the C3 style into the A style again?
    My hope is that there is a way, something like the nested style options, that allows me to define that style C should be used for 3 paragraphs and then the next style becomes style A again.
    Thanks.

    You just need two styles, almost identical, you can duplicate one.  The only
    difference is one has the next paragraph c and one has the next paragraph
    a.  After that I don't see the problem.

  • Applescript/Pages and adjusting column width (and paragraph style)

    I was hoping that some someone might know how to adjust the width of individual columns in Pages using Applescript. It seems like it should be a simple task, and I can adjust the overall width/height of the table, but I haven't found a way to adjust the column width. Alternatively, I could have the program create the table in Numbers and copy/paste it into Pages, but I'd imagine that would get a bit messy and wouldn't allow me to use a hanging indent in the cells (to the best of my knowledge).
    Also, is there a way to adjust the paragraph style used by the text in the table? Otherwise, I could just use a templet and define the the default table style appropriately. (Though not the most elegant solution).
    Thanks in advance for your help!
    (In case it helps, the script I'm working on parses an unformatted inventory and parses it into paragraphs/tables.)

    Try this:
    set tableCount to 0
    --open file to be pased here, excluded for example
    tell application "Pages"
        activate
        set theDoc to (make new document)
        tell theDoc
            --makes paragraph styles used
            make new paragraph style with properties {name:"Folio", font name:"Times New Roman", font size:12, bold:true, alignment:left, space after:5, keep with next paragraph:true, space before:15}
            make new paragraph style with properties {name:"Place", font name:"Times New Roman", font size:12, bold:false, alignment:left, line spacing type:relative, line spacing:100}
            make new paragraph style with properties {name:"Description", font name:"Times New Roman", font size:12, bold:false, italic:true, alignment:left, line spacing type:relative, line spacing:100}
            make new paragraph style with properties {name:"Table", font name:"Times New Roman", font size:12, alignment:left, left indent:0.5, first line indent:0.0}
            --begin repeat, gathers MS info from one doc (unformatted) and writes it into another with formatting, setting variables directly for example
            set MSName to "new Manuscript"
            set MSPlace to "place where MS is stored"
            set MSDesc to "description of MS"
            set tableData to {{"folio", "title", "composer"}, {"", "subtitle", ""}, {"etc", "next", "next"}}
            --write paragraph information from earlier
            set currentPar to (make new paragraph at end of paragraphs with data MSName)
            set paragraph style of currentPar to "Folio"
            set currentPar to (make new paragraph at end of paragraphs with data MSPlace)
            set paragraph style of currentPar to "Place"
            set currentPar to (make new paragraph at end of paragraphs with data MSDesc)
            set paragraph style of currentPar to "Description"
            --create table, add data, and format
            tell application "System Events" to tell process "Pages"
                key code 125 using {command down} -- move the insertion point to the end
                tell menu bar 1
                    -- Insert a new table:
                    click menu item "Table" of menu 1 of menu bar item "Insert"
                    -- Delete the header row:
                    tell menu 1 of menu bar item "Format"
                        click menu item "Delete Row" of menu 1 of menu item "Table"
                    end tell
                    -- Show the Inspector:
                    tell menu 1 of menu bar item "View"
                        if menu item "Show Inspector" exists then
                            click menu item "Show Inspector"
                        end if
                    end tell
                end tell
                tell window 1 -- the Inspector window
                    click radio button 7 of radio group 1 -- select the Table Inspector
                    perform action "AXRaise" -- activate the Table Inspector
                    tell tab group 1 of group 1
                        click radio button "Table" -- select “Table”
                        -- Reduce width of all three columns:
                        repeat 3 times
                            set value of text field 2 to "0.5 in"
                            set focused of text field 2 to true
                            keystroke return
                            keystroke tab -- next column
                        end repeat
                        key code 126 -- the Up Arrow
                        -- Set width of each column:
                        repeat with theValue in {"0.75 in", "4.25 in", "1.5 in"}
                            set value of text field 2 to theValue
                            set focused of text field 2 to true
                            keystroke return
                            keystroke tab -- next column
                        end repeat
                        key code 126 -- the Up Arrow
                    end tell
                end tell
                keystroke "i" using {option down, command down} -- hide the Inspector
                -- Add the data:
                repeat with i from 1 to 3
                    set thisRow to item i of tableData
                    repeat with j from 1 to 3
                        keystroke (item j of thisRow)
                        if (i * j = 9) then exit repeat
                        keystroke tab
                    end repeat
                end repeat
            end tell
            set tableCount to tableCount + 1
            tell table tableCount
                select
                set stroke width to 0.0
                set wrap to center
                set name to MSName
            end tell
            --after which it would continue with the next MS and repeat the process until all are done
        end tell
    end tell

  • [AS] How to change a paragraph style within any folder in Find Grep?

    I want to change both text and paragraph style
    I do that job very easily until I put paragraph styles in a folder
    How to express the paragraph style "passage" within the folder "1st" in AppleScript?
    In line 18 below, "1st:passage" may be wrong... so I've tried and search for an hour, but I can't get the answer..
    sorry for bad english
    my main()
    on main()
      mySnippet_test()
      myTeardown()
    end main
    on mySnippet_test()
              tell application "Adobe InDesign CS5.5"
                        set myDocument to document 1
                        set find grep preferences to nothing
                        set change grep preferences to nothing
                        set include footnotes of find change grep options to false
                        set include hidden layers of find change grep options to false
                        set include locked layers for find of find change grep options to false
                        set include locked stories for find of find change grep options to false
                        set include master pages of find change grep options to false
                        set find what of find grep preferences to "\\n"
                        set change to of change grep preferences to "\\r"
                        set applied paragraph style of change grep preferences to "1st:passage"
                        tell myDocument
      change grep
                        end tell
      --Clear the find/change preferences after the search.
                        set find grep preferences to nothing
                        set change grep preferences to nothing
              end tell
    end mySnippet_test
    on myTeardown()
    end myTeardown

    Replace the red line with… Replacing name strings to yours…
    set myStyle to paragraph style "Style A" of paragraph style group "Style Group 1" of myDocument
    set applied paragraph style of change grep preferences to myStyle

  • Quick paragraph style application transformation ... or reverse engineering a document the hard way?

    Hi everyone,
    I'm using Indesign 5.5 for Windows and have inherited a technical document with no styling applied (not even text threads or auto-pagination), but all the fonts are in the correct sizes and colours. So it looks ok in print, but trying to actually do anything with it is a nightmare.  For obvious reasons I WANT to apply paragraph styles to the document so I can generate a new auto-updating TOC, maintain and add to it, and all the other good stuff that means.
    My question is this - is my only choice to go through page by page and apply new styles (matching their current appearence) to every different heading and bullet point, or is there a nice easy way (or script) that i can use to whizz through the document for me, neatly applying a new style to each different font variety or element it finds (not altering their appearence) and leaving me with a nice list of styles I can rename (then take all the credit for? ha!) Basically take a document that's already been put together wrong, and make it right? I think this might've been imported into InDesign from something like Quark, hence the state it's in, but I don't have access to anything but this version. Any help you could offer would be great.  Oh, and if (as I suspect) my only option is indeed to apply all the styles manually one line at a time, then feel free to point and laugh, I doubtless deserve it.
    Thanks!
    Phil

    If you need to reproduce the existing page layouts, I'd suggest you read up more on what paragraph styles can do, before annihilating whatever layout and flow behaviors have been stuck on the content. For example, if level "X" headings always start at the top of a text frame, or top of a page, or even top of a right page, or top of a left page, a paragraph style property can do this. So you'd want to create and apply a paragraph that does this to those paragraphs before you thread text frames; the top of <whatever> frame paragraph property will keep the paragraphs in place.
    It is possible to create paragraph styles with properties that behave crazily when they do what you define for them. For example, you can define a paragraph style that sets the style of the paragraph that's created when you press Enter/Return. You can also use the smartness built into the Next Style property. If a paragraph style, say Head1 is defined to create a new paragraph when you press Enter/Return, it can also apply its next style property to the paragraph follows Head1 in the same text selection. So, if you select a paragraph that's supposed to become Head1 (which defines its next style as BodyAfterHead1) and also select the paragraph that follows it,  and then hold down Ctrl+Click on the Head1 style's name in the Paragraph Styles panel, Apply "Head1" then Next Style appears. If BodyAfterHead1 defines Body as its next style, and more than two consecutive paragraphs are selected, Head1 will be applied to the first paragraph, BodyAfterHead1 will be applied to the second paragraph, and Body will be applied to the third and following paragraphs.
    So, you'll be investing in setting up the Next Style property for paragraph styles, and selecting as many consecutive paragraphs as needed for applying a pattern of styles that agrees with your next style definitions. Each time you use this feature, you're collecting benefits from your investment.
    If you need to reproduce the look of the layout on some number of pages, you could export to PDF and use a script to efficiently place each page of a multi-page PDF on a "PDF layer" you create, that appears on every document page in the ID document, lock and move the layer below the active document layer, and use it as a placement underlay.
    Search Google for terms like "InDesign apply style and next style," "InDesign place multipage pdf script," "InDesign installing and using scripts," "InDesign paragraph style keep options," and "InDesign start paragraph options," without quotes, for informative links to anywhere on the Web, as well as on these Adobe forums. To limit the searches to Adobe forums only, include "forums.adobe" without quotes in the search query.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • [JS or AS] Applying Paragraph Styles.

    Hi,
    I have a JavaScript From Dave Saunders. Which Takes a list of all Para and Character styles from an InDesign File and make a .txt file.
    Which works great.
    So because I don't understand JavaScript and Very Basic Applescript.
    I have made a basic AppleScript which Creates a Document and place the .txt file which the JavaScript created.
    I know how to apply a Paragraph Style in AppleScript using the
    set applied paragraph style of paragraph 1 to ParaName
    My problem is I don't know how I can match and apply Paragraphs Styles and Character styles from the list generated from the .txt file to the corresponding Paragraph and Character styles in InDesign?
    Obviously if it could be all done Via JavaScript then yeah, otherwise AppeScript all do as well.
    Any help or ideas would be great.

    Thanks Shane
    Oh I didn't think I had to set myStory to anything as it's the only story, so I thought it's would automacticly make it the parent story...learn something new...
    I also forgot to import the Paragraph Style into the new document which I've fixed,
    but It falls over at the set applied paragraph line.
    tell application "Adobe InDesign CS3"
         --Pick file to import styles from
         set myFilePath to (choose file)
         --Create a new document.
         set mydoc to make document
         tell mydoc
              import styles format text styles format from myFilePath
         end tell
         tell page 1 of document 1
              set newFrame to make new text frame with properties {geometric bounds:{1, 1, 275, 210}}
              -- this line below will let me choose which file to place, in this case it's called MyDocumentStyles.txt which the Javascript made
              place (choose file) on newFrame
              set myStory to parent story of newFrame
              repeat with i from 1 to count of paragraphs of myStory
                   set thisStyleName to contents of paragraph i of myStory
                   if last character of thisStyleName = return then
                        set thisStyleName to text 1 thru -2 of thisStyleName
                   end if
                   set applied paragraph style of paragraph i of myStory to paragraph style thisStyleName
              end repeat
         end tell
    end tell

  • I want to open "Paragraph Style Options" dialogue using Script(jsx)

    Hi,
    I have created a paragraph style using JSX.
    var myDocument = app.activeDocument;
    var myParagraphStyle = myDocument.paragraphStyles.item("myParagraphStyle");
    Now I want to edit my paragraph style using the "Paragraph Style Options" window. How can I open the window for myParagraphStyle using JSX?
    Is there any way to do it? I don't want to manually double click the name in the list to open it.

    @kapoor_aman27 – with a little trick we could select a distinct paragraph style in the Paragraphs Style panel.
    Add a new text frame to the document, add some contents, one character is sufficient. Format its contents with your paragraph style. Set the Paragraph Styles panel to visible. Select the text in the text frame with something like that: app.select(myTextFrame.texts[0]). Remove the text frame; the paragraph style stays selected in the panel.
    The next step would be to invoke the "Paragraph Style Options" panel. The id for the appropriate scriptMenuAction is 8481.
    try{
    app.scriptMenuActions.itemByID(8481).invoke();
    }catch(e){$.writeln(e.message)};
    But unfortunately this would throw an error. Something like this:
    (Error message in German:)
    "Mit der angeforderten Aktion wurde ein asynchrones, modales Dialogfeld geöffnet,
    für das eine Vorschau erstellt werden kann.
    Dies ist nicht mit der Skriptarchitektur kompatibel, daher wurde das Dialogfeld
    mit der Standardschaltfläche automatisch verworfen."
    (Roughly translated to English:)
    "An asynchronous, modal dialog box was opened by this action.
    A preview can be created with that dialog box.
    This is not compatible with the scripting architecture, therefore the dialog box
    with the standard button was automatically rejected."
    So I see no chance to do what you want.
    (Tested with inDesign CS5.5 on Mac OSX 10.6.8)
    Don't know, if that behavior has changed for more recent versions of inDesign…
    Uwe

  • How do I stop ID from assigning a paragraph style to the TABLES?

    In-Design is adding "H1" paragraph style to EVERY table is inserted, so the table headers formatting is affected by that H1 style.
    I guess it chooses H1 because it's the FIRST style I created (and then modified the "basic paragraph" to modify the rest of default text).
    It's like it's adding "Style_ID=1"
    I tried placing the character in different places, to make sure it's not the style the cursor is in which is inherited, and no, no matter where I place the cursor, when I "insert table" the cursor is automatically placed into the first cell (header cell) and the paragraph "H1" is selected (and applied)
    Adding a table with NO headers does the same, so it's not me that confused style names and applied some to the wrong place.
    H1 is not used and table and cells styles are not based in it.
    I don't know whether it's a bug, but IT FEELS like a bug.
    How do I expect it to work?
    I expect that by creating a table, NO style be applied other than the table's. (Not even the basic one)

    You might have set the default paragraph style for the document (which you set by selecting a paragraph style with no text frame selected) to your H1 paragraph style.
    Make sure it's on "Basic paragraph" when you select the type tool..

  • Change paragraph style from X to Y in Pages Doc

    Hi
    Sorry for such a simple question, but I have looked through the Applescript manual and searched this forum and can't find a solution to my problem.
    All I want to do is loop through the paragraphs of a Pages document and if the paragraph style is "Body Full", then change it to "Body Half". I have tried if statements repeat statements and everything I can think of but can't seem to get it to work. I can loop through all the paragraphs and change them to "Body Half", but as soon as I try to select only those whose paragraph style = "Body Full" it doesn't change any.
    Here is an example of my attempt:
    tell front document of application "Pages"
    repeat with X from 1 to count (get paragraphs)
    if paragraph style of paragraph X = "Body Full" then
    set paragraph style of paragraph X to "Body Half"
    end if
    end repeat
    end tell
    If anyone could help I would be grateful. It's kind of embarrassing since I was a programmer for many years on mainframes and AS/400. Scripting is a new world to me.
    Thanks in advance.
    Jim

    Hello
    Jim Kahler wrote:
    I am also using iWorks 09. Now the indent level sets all paragraphs to the indent level of wherever the insertion point was when I ran the script.
    ? Still confused, it looks so easy!
    Jim
    Ok, i understand.
    Here is the solution :
    tell front document of application "Pages"
    set sel to selection
    set search_style to paragraph style "Body Full"
    set new_style to paragraph style "Body Half"
    repeat with X from 1 to count paragraphs
    tell paragraph X to if its paragraph style = search_style then
    select character 1
    set Y to indent level
    set its paragraph style to new_style
    set indent level to Y
    end if
    end repeat
    select sel
    end tell

Maybe you are looking for

  • What's the best way to use iTunes match with 4 iPhones and an ipad2

    Currently have iPhone 4 (2), iPhone 3GS, iPhone 3G (used as touch-no sim), and iPad 2.  We use one apple id to purchase with. We use a windows 7 pc and iTunes 10.5.....latest ver.  My questions are  kinda multi faceted, but I'm thinking iTunes match

  • Some "newb" questions - Network and BBM

    Morning - I have some questions, I'm hoping someone can answer.   Q1 - Presently the device (Curve 9300) is connecting to the router successfully but not connecting to the internet even though other devices are (the WiFi indicator is dim). Is there a

  • Report With Print Option

    Hi Everyone, I have requirement, i need to use PRINT icon in Outputlist, if the User clicks it should Print, is there any way to do this and the Program type is 'M'. can anyone suggest the best way to do this ?? From Nemani

  • Running out of disk space on root partition

    Hello, I'm running gnome 3 and every time I boot and logon with my user I'm getting a warning that my root partition is running out of disk space (~350MB free out of 7.5GB). This seems really strange to me since I've not installed very much software.

  • E71 corruption / installation issues

    Hi all, I was playing about with the remote lock feature last night and when I turned my phone on this morning it would appear that I somehow corrupted the memory card. I reformatted the card and did a restore to factory defaults and I noticed that n