Skip to main content
Participating Frequently
April 7, 2014
Question

replace anchored image by a character

  • April 7, 2014
  • 2 replies
  • 2680 views

How can i find and replace automaticaly an anchored image placed in a text, by a character ?

Thanks

This topic has been closed for replies.

2 replies

Participating Frequently
April 7, 2014

Thanks Vandy for your reply,

but your script replace all anchored images, even if they are different images,

i would like to change each image by a different character,

and the find and replace ou grep search (â or ~a) find all anchored images,

i can't find the one i want...

JCL

Inspiring
April 7, 2014

Only you know which one you want. How do you intend to communicate that to the script?

Or perhaps I should ask: which character goes with which image? You can use a search to find them all and then cycle through them with a for-loop to replace each individually.

How much help do you need? Have you written scripts yourself or are you looking for someone to write one for you?

Dave

Inspiring
April 10, 2014

Yes, I did.

But it doesn't work.

JCL


Could you select a paragraph that includes a character to which you have applied this character style you created, export that to tagged text and then post that tagged text here?

Thanks,

Dave

Brainiac
April 7, 2014

app.findGrepPreferences = app.changeGrepPreferences = null;

app.findGrepPreferences.findWhat = '~a'; //finding image

app.changeGrepPreferences.changeTo = 'image1'; //replacing with text

app.activeDocument.changeGrep();

app.findGrepPreferences = app.changeGrepPreferences = null;

Vandy