Applescript: Create Grep Style in a Paragraph style


hi all

 

 

i'm using following script create grep style within paragraph style.

 

 

however, can't apply character style? i'm using applied character style:"grep_no break-text" no luck!

 

here script:

 

 

tell application "adobe indesign cs6"

  activate

          tell active document

  -- make swatches ************************************************************************************

  -- make "**no break-text**" swatch

                    try

                              set mycolourswatch to swatch "**no break-text**"

                    on error

                              make new color with properties {model:process, space:cmyk, color value:{0, 100, 0, 0}, name:"**no break-text**"}

                    end try

 

  -- make character styles ************************************************************************************

                    --

  --no style name exists.

                    try

                              set mycharacterstyle to character style "grep_no break-text"

                    on error

  --the style did not exist, create it.

                              set mycharacterstyle to make character style with properties {name:"grep_no break-text"}

                    end try

  --at point, variable mycharacterstyle contains reference character

  --style object, can use specify formatting.

                    set no break of mycharacterstyle to true

                    set fill color of mycharacterstyle to "**no break-text**"

 

  -- make para styles  ************************************************************************************

  --no style name exists.

                    try

                              set myparagraphstyle to paragraph style "body - master"

                    on error

  --the style did not exist, create it.

                              set myparagraphstyle to make paragraph style with properties {name:"body - master"}

                    end try

                    tell paragraph style "body - master"

  make new nested grep style with properties {grep expression:"grep expression here"} -- works

  --make new nested grep style properties {grep expression:"grep expression here", applied character style:"grep_no break-text"} -- dosen't work

 

                    end tell

 

 

          end tell

end tell

make new nested grep style properties {grep expression:"grep expression here", applied character style:mycharacterstyle} should work



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support