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.

Similar Messages

  • Can you apply "Indent To Here" in a paragraph style (Bullets & Numbering Section)? ID-CS6/MAC

    Hi Adobe comunity,
    As the title of this discussion states, can I apply "Indent to here" within paragraph styles. Please take a look at the attached image which will give you an idea of my dilema.
    Any info on the matter would be greatly appreiated.
    PixelNovae
    MAC 10.6.8
    CS6 / ID: 8.0.1

    Peter,
    Thanks. this is definitely a work around. The only problem with this solution is that if a document has a ton of bullet levels, the designer has to perform and keep up a ton of math in order to do proper levels. Which is cumbersome. At the same time time, the Indent To Here (ITH) command is so much more cleaner and efficient specially when it comes to visual alignment of the when "shape shifting bullets" are used.
    Example:
    i. bullet
    ii. bullet
    iii. bullet
    In the above example, the ITH would create clean copy alignments thorought on all secondary line copy while the -/+ indents would not be able to remain consitent (unless the designer has to tweak every bullet with indent levels). That is, on the above example, the second lines on bullets ii and iii would be irregularly aligned.
    So i take it one cannot input the ITH command onto the "Number Field". Hmmph. lol

  • [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

  • 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

  • In Pages (5.5.1) can I create multiple Paragraph Styles within one paragraph?

    In Pages (5.5.1) can I create multiple Paragraph Styles within one paragraph. 
    I need to make a table of contents for my Mater's Thesis and want to use the automatic table of contents feature.  I want the first sentence of a paragraph to have a different paragraph setting than the rest of the paragraph.  Is this possible?
    Thanks!

    Nice of you to be doing this for your Mother's Thesis.
    There are several issues here:
    1. A Paragraph Style is what it says, the style for the paragraph
    2. You can format text within a paragraph by applying a Character Style
    3. Pages 5.5.1 lets you apply formatting to overall text for the T.O.C. but not parts of it and you can not retain that formatting as a Paragraph style
    So in answer to your question, no.
    You will need to create the T.O.C. manually and unfortunately as Pages 5.5.1 can't create bookmarks (just one of over 100 missing features) you will be unable to link the T.O.C. to the referred pages in the list.
    Peter
    Apple's marketing slogan:
    Pages 5.5.1 - Can't Do That!

  • Multiple paragraph styles within one cell?

    Maybe I'm missing something real simple but I'm having a bit of an issue with styles.  What I'm trying to do is have the name of a tool in one paragraph style and the description (separated from the name by "-") in another paragraph style - all within the same cell of a table.  Instead, when I try to change styles it changes all text within the cell.  Even if I go back and highlight the tool name and change it to a different style than the description it changes all text including what is not highlighted.  If anyone has a solution I would greatly appreciate it!

    Thanks, Dave!  Nested styles works perfectly.  I figured the solution would've been something simple like this.

  • Do paragraph style overrides work differently in CS3 vs CS4?

    Hi All-
    I’m in the process of moving a workflow from CS3 to CS4, and have run into an unexpected problem. In the existing CS3 workflow, we receive copyedited text with Word paragraph styles applied, then import this text into our InDesign template. This template has all the same paragraph style names as the Word file, so we tell InDesign to use the InDesign style definitions in the Import options. So, for instance, the Word style for Para_Text is Times New Roman 12pt, and the InDesign style for Para_Text is Helvetica Neue 8pt, and on Import InDesign automatically changes it to Helvetica Neue 8pt. This is as we want it.
    Things fall apart, however, when we import the same text into the same template in InDesign CS4. It still applies the InDesign style definition, but has additional overrides to make it look like the Word style definition. So, it recognizes that the underlying paragraph style should be Helvetica Neue 8pt, but it then preserves Times New Roman 12pt as an override. If I select the text and do Clear Overrides, it’ll revert to the Helvetica Neue 8pt we want it in, but for other reasons that solution is less than ideal.
    I think I can come up with a rather kludgy way around this, but I’m trying to understand exactly why we’re getting the different behavior in CS4. It seems like paragraph style conflicts are being handled in a different way in CS3 than CS4 – in CS3, if the InDesign paragraph style specifically spelled out a font, that would dominate on import; now, in CS4, it’s allowing the Word paragraph style to seep through as an override. Any thoughts as to why this is happening?
    Thanks,
    -Nate

    Hi Chris.
    Good news. I cant tell you how happy i am for all your help ;-) and you other guys.
    The latest Eizo 5.2.1 software fixed the problem on all 3 Eizo monitors.. Weeee
    I'm back to normal.
    Now i just have another damn problem started not long ago ;(
    My Photoshop CS3 and CS4 keeps crashing on me after a wile of work ???
    I tried everything. Deleted preffs etc. etc.
    It have been working for long long time but suddenly it keeps crashing all the time.
    I tried to remove some new plug-ins, but it was not that.
    Only thing i did also was to install new ram.
    Upgraded from 10GB to 14GB in all our Mac Pro.
    So after i tried to switch the ram around to check if some was bad.
    Also run some memory software but everything came out right.
    So now the only thing left is that Photoshop dosent like ram between 14GB & 16GB.
    Under was fine and i never tried over 16 gigs.. weird
    Any ide what could corse this ?

  • [AS, CS3] Change Values in [No Paragraph Style]

    Is it possible to change the value of [No Paragraph Style]? I tried this (it's a german version; composer is singe line composer, language is english: GB):
    tell application "Adobe InDesign CS3"
    tell active document
    set myInfo to {object reference, name} of paragraph style 1
    set myPara to item 1 of myInfo
    set ligatures of myPara to false
    set composer of myPara to "Adobe Ein-Zeilen-Setzer"
    set hyphen weight of myPara to 0
    set applied language of myPara to language "Englisch: Großbritannien"
    end tell
    end tell
    Thanks
    Tobias

    This is an "at your own risk" solution: export a .inx version of a document and edit the definition of No Paragraph Style in it. That will change it for that document and any derivative documents you make from it, but you can't change the application default.
    Dave

  • Find a specific paragraph style within a table and apply a specific cell style?

    I'm a total beginner when it comes to scripting, but I would like to create a script that finds the paragraph style "resultsUL" within a large table and applies the cell style "female". Sure wish the find/replace was able to account for cell styles as well as paragraph and character styles. Is anyone willing to help me with this? Thank you!

    Hi,
    I do it quickly defining a simple research on the "resultsUL" para style and using a loop with QuicKeys as:
    Cmd-0 is a shortcut associated to the "female" cell style.
    So, What I do: search the para style (Cmd-option-F) and apply the cell style, then search again…
    As easy to do with QuicKeys, I think that can be easily done with a [JS] (faster process!).

  • 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

  • [JS CS3] Find/Change "[Basic Paragraph]" style

    I'm trying to find all occurances of the [Basic Paragraph] style and replace them with [No Paragraph Style]. I'm using:
    app.findTextPreferences.appliedParagraphStyle = "[Basic Paragraph Style]";
    app.changeTextPreferences.appliedParagraphStyle = "[No Paragraph Style]";
    I get the message "Invalid value for set property 'appliedParagraphStyle'. Expected String, ParagraphStyle or NothingEnum enumerator, but received "[Basic Paragraph Style]"."
    I've tried every combination of brackets, no brackets, quotes, no quotes, etc. It doesn't seem like this can be scripted, even though it can be done via find/change in InDesign. Am I banging my head against the wall? Does anyone know if this can be done?

    "[Basic Paragraph]" as shown in the code below doesn't work either. (the word "Style" actually snuck in as I was trying different variations. But no combination seems to work.
    If anyone knows that [Basic Paragraph] can or cannot be accessed via scripting, I'd like to know. Thanks.
    app.findTextPreferences.appliedParagraphStyle = "[Basic Paragraph]";
    app.changeTextPreferences.appliedParagraphStyle = "[No Paragraph Style]";

  • [JS] [CS3] Finding the longest instance of a paragraph style

    I'm pretty new to JS but I'm trying to write a script that will return the longest instance of each paragraph style in a manuscript (which has been imported into InDesign). Currently, my script lists all the paragraph styles found in the document and puts them in a new document. My next thought was to loop through the style names array and find the longest instance.
    Could anyone point me in the right direction on how to do this?
    Any help is much appreciated. I'm learning a lot reading this forum.

    Your question is slightly ambiguous. Do you mean you are looking for the longest instance of a paragraph in that paragraph style? That's the most likely meaning. Or are you looking for the longest run of text in that style? Because that's what you'll find if you're not careful in your script.
    The essence of the script would be:
    1. Setup a FindText for the paragraph style in question (or each style if you're looping through them all).
    setupFindText(); // use function to setup the find -- search this forum on setupFindText to find it
    app.findTextPreferences.appliedParagraphStyle = myStyle; // where myStyle is the style in question
    2. Issue the find getting all the references into a variable.
    var myFinds = app.documents[0].findText();
    3. Loop through all the finds to locate the longest paragraph.
    var longestLength = 0;
    var longestPara = null;
    for (var j = myFinds.length - 1; j >= 0; j--) {
         myParas = myFinds[j].paragraphs;
         for (var k = myParas.length - 1; k >= 0; k--) {
              myPara = myParas[k];
              if (myPara.length > longestLength) {
                   longestLength = myPara.length;
                   longestPara = myPara;
    4. Make sure that longestPara is not null (no instances found); If not, then longestPara is a reference to the longest instance
    Dave

  • [CS3 AS] set paragraph style, go to next paragraph, set paragraph style, etc.

    hello,
    i'm pretty much a noob at scripting. i'd like to automate applying paragraph styles to a document with reviews.
    basically, i want to place the cursor in a paragraph (manually), and have a script do the following: set paragraph style 5, go to the next paragraph, set paragraph style 1, go to the next paragraph, set paragraph style 2, go to the next paragraph, set paragraph style 3.
    help?
    (i specified AS as i think i might understand it, but JS probably works as well)

    Assuming you set the relationship of one style to the next using the 'Next Style' definition in the paragraph styles, then the following should do the trick (assuming you have your cursor in the first paragraph).
    > // Follows next paragraph style setting until Same Style or No Paragraph Style
    >// Get the current pagaraph based on user cursor location
    var myCurrentParagraph = app.documents[0].selection[0].paragraphs[0];
    do
    ] // Currently applied paragraph style
    var myCurrentParagraphStyle = myCurrentParagraph.appliedParagraphStyle;
    ] // Next Style for current paragraph style
    var myNextParagraphStyle = myCurrentParagraph.appliedParagraphStyle.nextStyle;
    ] // Check current style and next style are not the same or No Paragraph Style
    if (myCurrentParagraphStyle == myNextParagraphStyle
    || myNextParagraphStyle == app.documents[0].paragraphStyles.item("[No Paragraph Style]") ) {
    ]] exit(); }
    ] // Get next paragraph in chain
    var myNextParagraph = myCurrentParagraph.insertionPoints[-1].paragraphs[0];
    ] // If we are end of story then stop
    if (myNextParagraph == myCurrentParagraph) { exit(); }
    ] // Apply next style to next paragraph
    myNextParagraph.appliedParagraphStyle = myNextParagraphStyle;
    ] // Restart the process
    myCurrentParagraph = myNextParagraph;
    >while (true)
    Note that the process will end when the Next Style setting of one paragraphs is Same Style or when the Next Style is No Paragraph Style. There would be other ways to end the process, such as limiting it to a certain number of steps if the number of steps was always the same. Let me know.

  • [JS, CS3] a script to change language in all paragraph styles

    Hi,
    I made a script to change the language in all paragraph styles to "French", but when I run it I get the error: "Invalid request on root style". Could you please tell me what am I missing?
    myDoc = app.activeDocument;
    myStyles = myDoc.paragraphStyles;
    for (i = 0; i < myStyles.length; i++)
    myStyle = myStyles[i];
    myStyle.appliedLanguage = "French";

    Thanks a lot!
    The problem is solved
    Ola

  • CS3 Find Font/Delete Paragraph Style/Redefine Paragraph Style Causes Crash

    I am running into a very frustrating issue where I cannot replace a paragraph style. The issue is that we used to use some adobe type fonts and want to move to the true type equivalent so that we don't have problems working on files between mac and pc. The problem occurs on both mac and pc on a variety of hardware (both c86 and ppc macs for example). When we open the document it identifies that the font cannot be found (example Palatino T1). When we click find font and select the regular ttf Palatino replacement and click Change All Indesign just vanishes and leaves a crash message with a ton of garbage and a read only memory error. The same happens if we change the font on some text and right click on aragraph style and click "redefine style" - there is a sudden crash.
    Trying to work around this I went into our templates and tried to change it there. Opening the paragraph style and selecting the new font caused it to crash upon selecting OK. Also trying to Make a new paragraph style works, but then when deleting the old one causes a crash no matter what combination of mapping or not mapping the old paragraph style we chose (we tried every option under the dialogue and selected several different styles to map to or none at all).
    This occurs on several different fonts and on several different templates. I have tried deleting the adobe font cache to no avail. Any help resolving this would be great - all our employees are going nuts over this problem.
    Thanks in advance for any help or suggestions!

    Peter, your latest post led me to an interesting revelation. When I change Palatino (t1) bold to Palatino Bold using Find/Change it is fine. When I change Palatino (t1) to any font using Find/Change there is a curious result! As soon as I click find first the page changes to the default template and all content is hidden. The 4 or 5 places where palatino occurs on the default template change fine, but then on the next click of FIND FIRST it crashes! So the problem is connected to "find first", not the actual change. My guess is this is an issue of with how the find/change jumps from the template to the individual page, but I'm not sure exactly what is happening.

Maybe you are looking for

  • Can't get mail from ipad after moving to icloud

    I just moved my ipad (imac and iphone) to the cloud last night and now don't have any emails on my ipad.  My iphone doesn't recognize the move either. Should I just go in to the store and get this fixed or is a quick fix?

  • Inserting text into a PDF

    Greetings all! I'm quite new to InDesign, but I'm thrilled to see such a vibrant community on the official forums. I'm getting along quite well with it, absolutley awesome program, I may be in love... But, I've hit something of a problem. I'm making

  • Macbook Pro/Canon help

    Hello i have a Canon Powershot Pro 1. I know its outdated but its what i love is there anyway i can get it to work on iphoto?

  • Airdrop discovery takes ages

    Hi, I'm posting a question here because every-time I want to use AirDrop, wether it be from my iPhone to my MacBook Air or vice-versa, AirDrop's searching of a device takes a really long time, and sometimes it doesn't even work at all. Both my device

  • HT3986 My iMac becomes completely window system. How can I go back to Lion OS?

    My iMac becomes completely window system. How can I go back to Lion OS?