/t5/indesign-discussions/as-cs3-find-change-inserting-soft-return-instead-of-hard/td-p/1085866Aug 08, 2008
Aug 08, 2008
Copy link to clipboard
Copied
Can anyone help identify why this script doesn't work? i want it to replace multiple returns with a single paragraph return. It's replacing with a soft return rather than a hard return.
I copied and pasted the find grep and change grep fields into the script. I even tried it by typing "\r" into the change grep field. Any thoughts? Much appreciated!
tell application "Adobe InDesign CS3"
--Clear the find/change preferences.
set find grep preferences to nothing
set change grep preferences to nothing
set find text preferences to nothing
set change text preferences to nothing
--Set the find options.
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
--delete multiple graphs
set find what of find grep preferences to "~b~b+"
set change to of change grep preferences to "
"
set myStory to parent story of item 1 of selection
tell myStory
set myFoundItems1 to change grep
end tell
set find grep preferences to nothing
set change grep preferences to nothing
/t5/indesign-discussions/as-cs3-find-change-inserting-soft-return-instead-of-hard/m-p/1085867#M337905Aug 08, 2008
Aug 08, 2008
Copy link to clipboard
Copied
You need to use ~b in the replacement field. Your existing version is<br />failing because the default line-end character in Script Editor is now a<br />linefeed, which is the character InDesign uses for a newline.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>
/t5/indesign-discussions/as-cs3-find-change-inserting-soft-return-instead-of-hard/m-p/1085868#M337906Aug 11, 2008
Aug 11, 2008
Copy link to clipboard
Copied
LATEST
Shane, thanks! This worked. What I meant to have written was that when copying "~b" from the find/change field in InDesign and pasting into Script Editor, and saving, it converted it automatically to a hard return. I didn't try it manually because sometimes the obvious is elusive! (to me at least)