Find/Change words (with GREP) and apply a style...
I need a Script for Find/Change words with GREP, and apply a paragraph style...
Thanks...
Hi Marcos,
If you want the script to create character styles: Bold , Italic, Bold Italic, etc, and replace local formatting with these styles, use scripts in post #3.
But if you want find and change words, or/and replace local formatting with styles defined by you, use FindChangeByList script.
If the latter, I recommend you to download and install Record Find Change script (written by Martin Fisher).
Then choose settings you need in Find-Change dialog – make sure they work as expected – and run Record Find Change script. A Notepad/TextEdit file will pop up with a line containing the recorded setting. Copy it, open FindChangeList.txt, delete the contents of this file and paste the line you just copied (or add it to the bottom of the file).
Repeat the process for all find-change operations you need.
Finally run FindChangeByList.jsx to make all changes in one go.
However, while using Record Find Change script, you may encounter a problem: it doesn’t record paragraph and character styles placed inside a group. But you can write references to such styles like so:
appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Style Group 1"). paragraphStyles.item("Paragraph Style 1")
Kasyan
Similar Messages
-
I have 2 games Words with Friends and Cityville that receives a Pop-up message form iTunes... "Connect to iTunes to use Push Notifications" and will not allow me to exit out of the app or play. How can I get this message to STOP?
Yes - I connected my phone to my computer / Itunes and went into the apps section, but from there I have no idea how to manage the push notifications. I even tryied going into itunes that is installed on my phone. I still cannot find anyplace to manage these popups. I have also gone into settings - notifiations - and tried turning all notifications for these apps all off but that didnt work either. Any guidance is MUCH appreciated - Im not sure where to go from here.
-
Find without small caps italic and apply cstyle
Hi All,
I have small caps (nested) line with italic text (see the screenshot), I have tried to apply the "small caps italic" character style successfully. After that I will apply the "small caps" cstyle to only small cap's text, but not working my script, can you please correct this.
var itals = ["Italic", "Light Italic", "LightItalic", "Book Italic", "Cursive", "Light Condensed Italic", "Book Condensed Italic", "Ultra Condensed Italic", "Ultra Italic", "Condensed Italic", "ThinItalic", "BookItalic", "LightItalic", "BookItalic", "UltraItalic"]
var smallCaps = ["Small Caps & Oldstyle Figures", "55Roman Small Caps & Oldstyle Figures", "smallCaps"];
Fix_All_SmallCaps_Italic()
function Fix_All_SmallCaps_Italic()
try
var myCStyle7 = app.activeDocument.characterStyles.item("15 Small Caps Italic").name;
catch(myError)
var myCStyle7 = app.activeDocument.characterStyles.add({name: "15 Small Caps Italic", capitalization: Capitalization.SMALL_CAPS, fontStyle: "Italic"})
for(i=0; i<itals.length; i++)
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.fontStyle = itals[i];
app.findTextPreferences.capitalization = Capitalization.SMALL_CAPS;
app.changeTextPreferences.appliedCharacterStyle = "15 Small Caps Italic";
app.activeDocument.changeText();
//~ exit(0);
Fix_All_SmallCaps();
function Fix_All_SmallCaps()
try
var myCStyle6 = app.activeDocument.characterStyles.item("15 Small Caps").name;
catch(myError)
var myCStyle6 = app.activeDocument.characterStyles.add({name: "15 Small Caps", capitalization: Capitalization.SMALL_CAPS})
for(sc=0; sc<smallCaps.length; sc++)
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.fontStyle = smallCaps[sc];
app.changeTextPreferences.appliedCharacterStyle = "15 Small Caps";
app.activeDocument.changeText();
//find attribute and apply character style
var myDoc = app.activeDocument;
var mcstyle = app.activeDocument.characterStyles.item("15 Small Caps Italic").name;
app.findTextPreferences = app.changeTextPreferences = null;
app.findTextPreferences.capitalization = Capitalization.SMALL_CAPS;
app.changeTextPreferences.appliedCharacterStyle = "15 Small Caps";
var myFind = myDoc.findText();
for(var j=0; j<myFind.length; j++){
if(myFind[j].appliedCharacterStyle.name == mcstyle){
alert(myFind[j].contents)
continue;
else if (myFind[j].appliedCharacterStyle.name != mcstyle){
app.activeDocument.changeText();}Hi Jarek,
I can't get the output,
itals = ["Italic", "Light Italic", "LightItalic", "Book Italic", "Cursive"]
Fix_All_SmallCaps_Italic()
function Fix_All_SmallCaps_Italic()
try
var myCStyle7 = app.activeDocument.characterStyles.item("15 Small Caps Italic").name;
catch(myError)
var myCStyle7 = app.activeDocument.characterStyles.add({name: "15 Small Caps Italic"})
try
var myCStyle6 = app.activeDocument.characterStyles.item("15 Small Caps").name;
catch(myError)
var myCStyle6 = app.activeDocument.characterStyles.add({name: "15 Small Caps"})
for(i=0; i<itals.length; i++)
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.capitalization = Capitalization.SMALL_CAPS;
app.findTextPreferences.fontStyle = itals[i]
var myFind = app.activeDocument.findText();
for (j=0; j<myFind.length; j++)
if (app.findTextPreferences.fontStyle == itals[i])
app.changeTextPreferences.appliedCharacterStyle = "15 Small Caps Italic";
app.activeDocument.changeText();
else if (app.findTextPreferences.fontStyle != itals[i])//I locked here
app.changeTextPreferences.appliedCharacterStyle = "15 Small Caps";
app.activeDocument.changeText();
Can you please correct this.
selva -
I purchased an ipad for my husband in 12/2011 - it was stolen last night and i can't find the receipt with insurance and warranty.
The warraty doesn't cover lost or stolen.
If the iPad was running iOS 7, the thief/finder will not ever be able to use it.
iCloud: Find My iPhone Activation Lock in iOS 7
http://support.apple.com/kb/HT5818
Apple (and no one else) can not assist (with serial number or iCloud) in finding a lost or stolen iPad.
Report to police along with serial number. Change all your passwords.
These links may be helpful.
How to Track and Report Stolen iPad
http://www.ipadastic.com/tutorials/how-to-track-and-report-stolen-ipadhttp://www.ipadastic.com/tutorials/how-to-track-and-report-stolen-ipad
Reporting a lost or stolen Apple product
http://support.apple.com/kb/ht2526
What to do if your iOS device is lost or stolen
http://support.apple.com/kb/HT5668
iCloud: Locate your device on a map
http://support.apple.com/kb/PH2698
iCloud: Lost Mode - Lock and Trace
http://support.apple.com/kb/PH2700
iCloud: Remotely Erase your device
http://support.apple.com/kb/PH2701
Report Stolen iPad Tips and iPad Theft Prevention
http://www.stolen-property.com/report-stolen-ipad.phphttp://www.stolen-property.com/report-stolen-ipad.php
How to recover a lost or stolen iPad
http://ipadhelp.com/ipad-help/how-to-recover-a-lost-or-stolen-ipad/
How to Find a Stolen iPad
http://www.ehow.com/how_7586429_stolen-ipad.htmlhttp://www.ehow.com/how_7586429_stolen-ipad.html
What NOT to do if your iPhone or iPad is lost or stolen
http://www.tomahaiku.com/what-not-to-do-if-your-iphone-or-ipad-lost-or-stolen/http://www.tomahaiku.com/what-not-to-do-if-your-iphone-or-ipad-lost-or-stolen/
Apple Product Lost or Stolen
http://sites.google.com/site/appleclubfhs/support/advice-and-articles/lost-or-st olen
Oops! iForgot My New iPad On the Plane; Now What?
http://online.wsj.com/article/SB10001424052702303459004577362194012634000.html
If you don't know your lost/stolen iPad's serial number, use the instructions below. The S/N is also on the iPad's box.
How to Find Your iPad Serial Number
http://www.ipadastic.com/tutorials/how-to-find-your-ipad-serial-numberhttp://www.ipadastic.com/tutorials/how-to-find-your-ipad-serial-number
iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number
http://support.apple.com/kb/HT4061
Cheers, Tom -
Finding last characters with grep
I am lousy with grep and didn't find the solution with google, so let's ask here (help me out, please...)
I need to find last 7 characters of a paragraph and assign a character style "no break" to it. I know everything else, but what's the string to find the 7 last characters (incl. white spaces, digits and letters).
Thanks in advance.try searching for .{7}$
-
Find a window in XMonad and apply some actions to it
Hi everyone, I think this should be really easy for someone who's good at Haskell but I just couldn't figure it out as I'm bad at it.
Basically I want to search through the list of windows in the current workspace, find one matching some condition and apply some action to it; if not found then create this window.
I had a skeleton code like this
import qualified XMonad.StackSet as W
import XMonad.Actions.WindowGo
findWindow condition actionIfFound actionIfNotFound =
ifWindow (condition <&&> member W.current) windowFound actionIfNotFound
where windowFound = ask >>= w -> do actionIfFound wHi guymatsuda,
If you are having an issue locating a previously purchased song, you may find the following articles useful:
iTunes: Finding lost media and downloads
http://support.apple.com/kb/TS1408
Apple Support: Downloading past purchases from the App Store, iBookstore, and iTunes Store
http://support.apple.com/kb/HT2519
Cheers,
- Brenden -
I entered my email in word with friends and it did not allow me to sign on. It said I needed to activate the email. How do I do that?
What does: "I entered my email in word with friends" mean? Please explain better your problem and what you want to do.
-
How to find index name with primarykey and column on a table?
Hi,
how to find index name with primarykey and column on a table?
please help me.
Thankyou.1 select ac.table_name, ac.index_name, aic.column_name
2 from user_constraints ac, user_ind_columns aic
3 where ac.constraint_type = 'P'
4 and ac.index_name = aic.index_name
5* order by 1,2,3
SQL> /
TABLE_NAME INDEX_NAME COLUMN_NAME
ACTION_TABLE SYS_C0011033 NESTED_TABLE_ID
ACTION_TABLE SYS_C0011033 SYS_NC_ARRAY_INDEX$
CATEGORIES_TAB SYS_C0011038 CATEGORY_ID
CUSTOMERS CUSTOMERS_PK CUSTOMER_ID
INVENTORIES INVENTORY_IX PRODUCT_ID
INVENTORIES INVENTORY_IX WAREHOUSE_ID
LINEITEM_TABLE SYS_C0011034 NESTED_TABLE_ID
LINEITEM_TABLE SYS_C0011034 SYS_NC_ARRAY_INDEX$
ORDERS ORDER_PK ORDER_ID
ORDER_ITEMS ORDER_ITEMS_PK LINE_ITEM_ID
ORDER_ITEMS ORDER_ITEMS_PK ORDER_ID
PRODUCT_DESCRIPTIONS PRD_DESC_PK LANGUAGE_ID
PRODUCT_DESCRIPTIONS PRD_DESC_PK PRODUCT_ID
PRODUCT_INFORMATION PRODUCT_INFORMATION_PK PRODUCT_ID
PROMOTIONS PROMO_ID_PK PROMO_ID
WAREHOUSES WAREHOUSES_PK WAREHOUSE_ID
16 rows selected. -
Find inline objects and apply object styles...
Hi Eveyone,
I am trying to find placed inline rules and apply object styles through javascript. Because we need some baseline shift to those rules. I getting some error while find the rules. FInd the syntax below,
app.findObjectPreferences=app.changeObjectPreferences=null;
app.findChangeObjectOptions.properties =
objectType: ObjectTypes.unassignedFramesType
app.findObjectPreferences.strokeWeight=1;
app.changeObjectPreferences.appliedObjectStyles=app.activeDocument.objectStyles.item("WOL" );
app.activeDocument.item(0).changeObject();
Can anyone look into this help for me. Thanks in advance.
Regards
ThiyaguHi Dave,
I have tried the script after removing "s" in it. Now i am getting error like "object doesn't support the property or method 'appliedObjectStyle'". Please look into this and help me out. Herewith i attached the 'error' dialog snapshot.
When i tried this in loop its working fine. Find the script below.
app.findObjectPreferences=app.changeObjectPreferences=null;
app.findChangeObjectOptions.properties =
objectType: ObjectTypes.unassignedFramesType
app.findObjectPreferences.strokeWeight=1;
myFindObj=app.findObject(true);
for(i=0;i<myFindObj.length;i++){
myFindObj[i].appliedObjectStyle=app.activeDocument.objectStyles.item("WOL");
alert ("DONE!");
Regards
Thiyagu -
Hi people,
I need to find a word, prefferably using GREP or simple Find/Replace tool.
Sometimes, when I get source text to paste into InDesign, some word's format is messed up. First letter is italic and rest is regular or otherwise (or any other font format). How can I find such words automatically. For example:
Example
would really appreciate any help.
best regards
JMG.Hi,
If I had to do that, using Multi-Find/Change, I would play it like:
With MFC, I create a set of the 2 regex. So, one click to fix your problem. -
The find function seems to have changed in Firefox. Before, when doing a (CTRL + F) find, the search was not CAPS-specific or non-caps-specific. In other words, if I typed in "firefox" (no caps), it would find the words "firefox", Firefox", or "FIREFOX", regardless of capitalization. Now, however, the find function will only match the exact same capitalization. This totally undermines the usefulness of the function, and is a major hassle. Please fix it.
== This happened ==
A few times a week
== I noticed in in the last two or so weeks.I am having a similar problem. The following page has the word Dangerfield in several times. My browser will get to Dang and turns pink
http://www.genuki.org.uk/big/eng/HEF/ProbateRecords/WillsD.html
Is it my Browser or is there a problem with Mozilla?
I have also noted on other Google searches the same problem. Te term is listed in the page but Ctl F will not find the term -
Find/Change help with wildcard numbers...
hello... i'm looking for help with wildcards...
i have a specific task to complete.. i need to add dash & space into a space in a string of letters and characters...
here
221kbps - 00:28:34space dash space here47Mb - 44.1 kHz
198kbps - 01:27:43 41Mb - 44.1 kHz
215kbps - 00:34:52 156Mb - 44.1 kHz
225kbps - 00:32:14 54Mb - 48 kHz
so my finished text will look like this
221kbps - 00:28:34 - 47Mb - 44.1 kHz
198kbps - 01:27:43 - 41Mb - 44.1 kHz
215kbps - 00:34:52 - 156Mb - 44.1 kHz
225kbps - 00:32:14 - 54Mb - 48 kHz
there are many variables to the text - but i thought perhaps i could create a wildcard digit find/change based on the Mb bit, replacing the single space with space dash space
BUT
i need to retain the numbers before the Mb
so my question - is it possible to RETAIN WILDCARD NUMBERS?
merci beaucoup!omg... just fell of my chair
tried it in text - no joy...
tried it as a grep.
YES YES YES
thankyou so much - i have about 18,000 to format for a music website...
www.littledogdiscs.co.uk
if you ever find your way to our neck of the woods in the South of France - please do visit my b&b
www.maisonverdigris.com
i have a bottle of vintage champagne with your name on it...
thanks
teresa -
Find Change window too large and I cannot make it smaller
In Indesign CC the find/change window is continually resizing. This happens when I place a larger block of text into the find or replace field. After a few such changes I end up with a window as wide as my screen. I am able to get rid of it by restarting Indesign and resetting the preferences at restart. This is not a solution. How can this window be reduced in size or better yet set to remain at a fixed size.
I am operating on a Mac with system: 10.10.2
Thanks
ScottIn Indesign CC the find/change window is continually resizing. This happens when I place a larger block of text into the find or replace field. After a few such changes I end up with a window as wide as my screen. I am able to get rid of it by restarting Indesign and resetting the preferences at restart. This is not a solution. How can this window be reduced in size or better yet set to remain at a fixed size.
I am operating on a Mac with system: 10.10.2
Thanks
Scott -
Can't find "key words" with accentuated characters
Since I have installed Aperture 3, I can't find pictures with a "key word", if the key word contains an accentuated. Otherwise, it works fine. I have verified this many times. For example if I search for the word "érable", Aperture won't find the pictures, but if I search "rable", it will find all the pictures associated to those syllables. I have tried that with many words, with the same result. I also tried to search "erable" (without the acute accent on the "e") and Aperture did not find the pictures.
Since I use a lot of French accentuated words, this is a big problem.
Does anybody else have that problem?
Does somebody have a solution?
Thanks for helping.I was able to replicate the problem on my system, all updates current. The best way to alert Apple is via the link provided right within Aperture. Go to the menu bar item *Aperture > Provide Aperture Feedback*.
-
Find & Replace the text and apply paragraph style in indesign CS2.
Hai below script are working in cs4 - cs5.5. i need to run the script in indesign cs2.
can you please help.
Main();
function Main() {
var foundItem;
var doc = app.activeDocument;
//app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
app.findTextPreferences.findWhat = "^p";
//app.findTextPreferences.appliedParagraphStyle = "head";
var foundItems = doc.findText();
for (var i = 0; i < foundItems.length; i++) {
foundItem = foundItems[i];
foundItem.applyParagraphStyle(doc.paragraphStyles.item("content body indent"), false);
app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
var myDocument = app.activeDocument;
//Clear the find/change text preferences.
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
//Set the find options.
app.findChangeTextOptions.caseSensitive = false;
app.findChangeTextOptions.includeFootnotes = false;
app.findChangeTextOptions.includeHiddenLayers = false;
app.findChangeTextOptions.includeLockedLayersForFind = false;
app.findChangeTextOptions.includeLockedStoriesForFind = false;
app.findChangeTextOptions.includeMasterPages = false;
app.findChangeTextOptions.wholeWord = false;
//Search the document for the string "copy" and change it to "text".
app.findTextPreferences.findWhat = "^p";
app.changeTextPreferences.changeTo = "^p";
myDocument.changeText();
//Clear the find/change text preferences after the search.
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
abc();
function abc() {
var foundItem;
var doc = app.activeDocument;
//app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
app.findTextPreferences.findWhat = "*";
//app.findTextPreferences.appliedParagraphStyle = "head";
var foundItems = doc.findText();
for (var i = 0; i < foundItems.length; i++) {
foundItem = foundItems[i];
foundItem.applyParagraphStyle(doc.paragraphStyles.item("RealEstate"), false);
app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
var myDocument = app.activeDocument;
//Clear the find/change text preferences.
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
//Set the find options.
app.findChangeTextOptions.caseSensitive = false;
app.findChangeTextOptions.includeFootnotes = false;
app.findChangeTextOptions.includeHiddenLayers = false;
app.findChangeTextOptions.includeLockedLayersForFind = false;
app.findChangeTextOptions.includeLockedStoriesForFind = false;
app.findChangeTextOptions.includeMasterPages = false;
app.findChangeTextOptions.wholeWord = false;
//Search the document for the string "copy" and change it to "text".
app.findTextPreferences.findWhat = "*";
app.changeTextPreferences.changeTo = "";
myDocument.changeText();
//Clear the find/change text preferences after the search.
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
ab();
function ab () {
var foundItem;
var doc = app.activeDocument;
app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
app.findTextPreferences.findWhat = " ^ ";
app.changeTextPreferences.changeTo = " ";
//app.findTextPreferences.appliedParagraphStyle = "head";
var foundItems = doc.findText();
for (var i = 0; i < foundItems.length; i++) {
foundItem = foundItems[i];
foundItem.applyParagraphStyle(doc.paragraphStyles.item("day"), false);
app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
var myDocument = app.activeDocument;
//Clear the find/change text preferences.
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
//Set the find options.
app.findChangeTextOptions.caseSensitive = false;
app.findChangeTextOptions.includeFootnotes = false;
app.findChangeTextOptions.includeHiddenLayers = false;
app.findChangeTextOptions.includeLockedLayersForFind = false;
app.findChangeTextOptions.includeLockedStoriesForFind = false;
app.findChangeTextOptions.includeMasterPages = false;
app.findChangeTextOptions.wholeWord = false;
//Search the document for the string "copy" and change it to "text".
app.findTextPreferences.findWhat = "^";
app.changeTextPreferences.changeTo = "";
myDocument.changeText();
//Clear the find/change text preferences after the search.
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;@s_ashok – you'll find the right methods and properties in the CHM file for InDesign CS2 at:
http://www.jongware.com/idjshelp.html
Just a few hints:
InDesign CS2 does not support GREP search/replace, so every line in your code that points to GREP does not work.
Further: "app.findTextPreferences" and "app.changeTextPreferences" were "app.findPreferences" and "app.changePreferences" in InDesign CS2. And then there were no "findChangeTextOptions" or any counterpart for that in CS2…
That should get you running…
I have no InDesign CS2 installed to debug, so this is all I can say…
Uwe
Maybe you are looking for
-
Message missing from alert box & Can you disable everything until user selects an answer?
Question 1 - My alert box window is working, and the title and buttons function as they should, but does anyone know why my message is not showing up? Question 2 - How do you program the alert box window so that no other buttons on your application w
-
Opening Centered Pop-up window with Dynamic URL
I got some code for a centered pop-up window in Flash from a Kirupa tutorial. It works well, except that you are supposed to put an actual URL for the 'address' variable. I'm using a dynamic URL (+url[p]+) for my URL. When I put address = "'+url[p]'"
-
Guyz, i'm in the process of adding a custom field on me21n transaction and upon going through the documentation of aforementioned badis, i assumed i should get my own tab and field by just overwriting code in SUBSCRIBE & MAP_DYNPRO_FIELDS of badi ME
-
Problem passing oracle.sql.ARRAY to Oracle
I am having ClassCastException when I try to pass a oracle.sql.ARRAY to a Oracle Package. Here is my code: PreparedStatement stmt = null; String strArray[] = { "1,2,3,4,5" }; ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( "TEST_PAC_1.
-
Startup Problem & "Zapping the Pram"
Okay, I'm having startup problems, and I did the Command/Option/P/R startup. Next, I know that Command S, or Option S, something like that should take me to a startup equivilant of Disk Utility. It's been so long, I forgot what to do. I searched but