Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Find and change hyperlinks using GREP query

$
0
0

Hi,

 

I have found following code snippet in one of the post (Thanks to Jongware).

 

Can you please help me on how to use this to suite my requirement.

 

// use your standard GREP search & replace

    app.changeGrepPreferences = null;

    app.findGrepPreferences = null;

    // note ? mark in following GREP search string, the non-greedy modifier. Thanks Jongware!

    var myString = "app.findGrepPreferences.properties = {findWhat:\"<>(.*?)<\/>\"};";

    myString += "app.changeGrepPreferences.properties = {changeTo:\"$1\", appliedCharacterStyle:\""+characterStyle+"\"};";

    myString += "app.findChangeGrepOptions.properties = {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true};";

    app.doScript(myString, ScriptLanguage.javascript);

    var myFoundItems = docRef.changeGrep();

    //Reset the find/change grep preferences after each search.

    app.changeGrepPreferences = null;

    app.findGrepPreferences = null;

 

 

I tried the following.

 

var RateItgrepForFind = "app.findGrepPreferences.properties = {findWhat:\"(\\d+\\u+\\d+-\\d+\\u+)(W)};";

var RateItgrepForReplace = "app.findGrepPreferences.properties = {changeTo:\"$1N};";

 

 

But it is not working. Please help.

 

Regards,

Muthuraj. D


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>