Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[AS] CS3 Find -Change inserting soft return instead of hard

Guest
Aug 08, 2008 Aug 08, 2008
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


end tell
TOPICS
Scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 08, 2008 Aug 08, 2008
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>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 11, 2008 Aug 11, 2008
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)

Thanks again.

Jim
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines