1 Reply Latest reply on Jun 24, 2008 4:18 PM by sstanleyau

    Moving text from one place to another

      This is a Macintosh AppleScript questions on InDesign CS3.

      I want to move a portion of a paragraph several lines down. Here's what I want to do:

      Select from the word "Clutch:" to end of the line (including the paragraph return)

      Cut the selection

      Paste cut text at left margin, two lines down

      Repeat to end of story

      Can anyone help?
        • 1. Re: Moving text from one place to another
          sstanleyau Level 4
          It sounds like you want something like this:<br /><br />tell application "Adobe InDesign CS3"<br />    tell document 1<br />        tell prent story of text frame 1 -- or whatever<br />            considering case<br />                set parCount to count of paragraphs<br />                repeat with i from (parCount - 2) to 1 by -1 -- work from<br />end<br />                    if paragraph i contains "Clutch:" then<br />                        set theWord to (object reference of word 1 of<br />paragraph i whose contents = "Clutch:")<br />                        move (text from character 1 of theWord to character<br />-1 of paragraph i) to after character -1 of paragraph (i + 2)<br />                    end if<br />                end repeat<br />            end considering<br />        end tell<br />    end tell<br />end tell<br /><br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>