[CS3 JS] Find/Change Object Problem

app.changeObjectPreferences = NothingEnum.nothing does not seem to clear the change object preferences for me.
app.findObjectPreferences = NothingEnum.nothing works as expected, as do both app.findTextPreferences = NothingEnum.nothing and app.changeTextPreferences = NothingEnum.nothing.
Does anyone else use the new Find/Change Object?

Hello. I'm new here but it seems to be the only place where I can post this question to.
I'm working in a C# application that uses InDesign CS3 scripting. I'm trying to create an index automatically from a tabbed list of words in a text file.
As C# is a strongly typed language, I have to cast all objects to the right type. I'm having problems when I try to add the page numbers to the created index entries using the following code (I've used the CreateIndexEntry.jsx scrip as a starting point).
//Find all occurrences of the word or set of words (the topic name)
((InDesign.FindTextPreference) app.FindTextPreferences).FindWhat = topic.Name;
InDesign.Objects foundTexts = doc.FindText(System.Reflection.Missing.Value);
It's supposed to be an Array of Text objects (InDesign.Text) but when I try to cast each object using this
//Code is forced because I've tried everything here
//Loop through each finding and add page numbers to topic
IEnumerator textEnum = foundTexts.GetEnumerator();
while (textEnum.MoveNext())
object text = textEnum.Current;
topic.PageReferences.Add((InDesign.Text)text, InDesign.idPageReferenceType.idCurrentPage, System.Reflection.Missing.Value, System.Reflection.Missing.Value);
I got the following exception (translated).
text is not an InDesign.Text object (Interfaces doesn't match)
So the question is what object type should I use to cast each object resulting by calling the Document's FindText method.
Every suggestion will ve very welcome.
Thank You very much.

Similar Messages

  • Find/Change object size width

    Hi guys,
    So this is the problem:
    I have over 900 pages long catalog and I made a little changes to a textframe options and other object styles, but bottomline is that now I have to change all the textframes width to 62 mm (its now 61 mm). I have tried the Find/Change "Object" options, but I just can't find the right way to do it. Is it even possible to do it with the Find/Change Object? I have to change over 6000 textframes manually if this dosen't work :/
    Do I have to do this with Grep scripting and how is that possbile if I have to do it with it?
    Thanks beforehand if you reply to this problem!

    Ha!
    I found the solution(ish), basically it's possible to change object dimensions with the "Find/Change Object". Thanks Bart Van de Wiele for the "Columns Fixed width" tip.
    ."Find Object Format" -> What kind of "Object style" you are looking for and then put "Text Frame Options" -> Width (exp. 55 mm)
    "Change Object Format" -> go to "Text Frame General Options" -> "Columns: Fixed width" -> width (exp. 56 mm, I have 3 mm inset spacing left&right so 56 + 6 is 62 mm).
    Change the desired textframes, BUT THEN you have this kind of problem where you can not change the textframes width sizes because they are "fixed sized".
    Click one of the changed textframes and go to "Style options" where you get that "+" -sign. Click in the options "Clear overrides".
    Now you have changed the all desired textframes and you can change the width too.

  • Find/Change object size

    We have a document where each page header/number needs to be changed to a different language. We can find change the text ok but when the text is changed the text box is too small. Unfortunately the headers are not on master pages and the colours vary depending on the background colour.
    How can we do a find/change for the size of the text box?
    We want a text box of size 5mm x 20mm to change to 5mm x 35mm, expanding to the right.
    As far as I can see there is no way to do this with the inbuilt find/change object. Any ideas?

    I think you're doing it a weird way, but who am I to criticise, I've done far weirder things.
    If you don't want to add this to the master page then that's fine, I think you'd be better off and it would make things easier in the long run.
    For changing the width of a frame you'd need a script to that, and I really cannot help you on that one, scripts are not my forté.

  • What changed in the Find/Change Object behavior?

    In Indesign CS4 all graphics in a document could be centered through the Find/Change feature (Object tab) by leaving the Find field blank and setting the Change field to "Fitting Reference Point: Center" (clicking the center button). This no longer works in CS5. The feedback is of x number of objects changed, but none have.
    It was handy, now it's gone.

    No objects locked.
    Actually, it seems stranger.
    (BTW- The CS4 version is running on a Power Mac G5, pre-intel, Tiger.
    The CS5 Version is on a  Power Mac G5, Intel, Snow Leopard.)
    If a single graphic is dragged or placed in the document, the Find/Change, as described, does nothing. When a second one is added, it works as expected, unless they are both jpegs or PSDs. In that case, they sometimes, disappear completly and are shown to be (in the links panel) on the pasteboard but not visible there. But, get this, add a pdf or AI file to the doc, and run it again and it works fine again. The revese order also applies. If I delete all but one graphic it stops working again.
    In all cases the fitting commands work fine.
    It seems as if there is some confusion in how the document object model is being addressed and filetype is in the mix.

  • [CS3] [JS] Find Change Aesthetic Kerning Pairs

    Hi,
    I want to find and "erase" all the aesthetic kerning values in a document with Find Change.
    How do I say: "app.findTextPreferences.kerningValue" != (zero or null)
    Thanks
    PJB

    Can't do that. ID can't find "other" attributes, only specified ones.
    This one regularly bites me when authors don't use Superscript and Subscript, but make their text a few pts smaller and move it up/down a few points -- and I bet it's their (w|W)ord processor that does it!
    "A" solution (as opposed to "the") is to mark all 'good' text with S&R with a color, then search for orginally-colored text.
    .. Although, in your case, I think you can set all kerning to 0 and be done with it.

  • Unable to find referenced  object  problem

    Hi ,
    when i made compile for Adf BC Application Jdeveloper version ( 11.1.2.3 ) , it result compile error
    Error : ************ unable to find referenced object Object=************** Owner= ********************
    Notes :- this application contains view objects that depend upon jar file for the Entity Object

    Hi,
    Did you add the dependencies
    http://docs.oracle.com/cd/E15051_01/web.1111/b31974/reusing_components.htm
    http://andrejusb.blogspot.com/2011/04/strange-day-adf-library-profile.html
    http://adfhowto.blogspot.com/2010/10/adding-lib-jar-dependency-to-my-project.html

  • [CS3][JS] find/change quotation marks to typographer quotes

    my document contains a lot of quotation marks but they are not typographic (the opening one and the closing one are similar (") i want them to be typographic. I tried this script and it doesn't work.
    var myDoc = app.activeDocument;
    app.findGlyphPreferences = NothingEnum.nothing;
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences.appliedFont = app.fonts.item("Times New Roman  Regular");
    app.findGlyphPreferences.glyphID = 5;
    var myFoundItems = myDoc.findGlyph();
    app.changeGlyphPreferences.appliedFont = app.fonts.item("Times New Roman  Regular");
    var r=0;
    for(i=0;i<myFoundItems.length;i++){
      app.changeGlyphPreferences.glyphID = 179;
        myFoundItems(r).changeGlyph();
    app.changeGlyphPreferences.glyphID = 180;
        myFoundItems(r+1).changeGlyph();
        r+=2;

    Hi Peter,
    your solution is pretty good while the pairs of quotes are complete and you only use one sort of typographer quotes.
    But what if once the final quote is missing?
    Or if you want to use different language sensitive quotes for a document with multilingual text?
    Another approach is to take use of the execution of typographer quotes of InDesign itself.
    First you will have to activate typographer quotes:
    app.activeDocument.textPreferences.typographersQuotes = true;
    If you now change " with " you will get ".
    That's not what you have been looking for. ;-)
    You first have to make all non-typographical quotes to one specific typographical quote (right or wrong) or a placeholder. And than you have to change the specific typographical quotes to the non-typographical quotes (sic!). After that you will find your language-sensitive quotes.
    Here is an example.
    var myDoc = app.activeDocument;
    var myRange = (app.selection.length == 1 )
    ? app.selection[0]
    : myDoc;
    myDoc.textPreferences.typographersQuotes = true;
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.appliedFont = myDoc.paragraphStyles[1].appliedFont.fullName;
    theChangeGrep ( '\[\\x{0027}\\x{2019}\\x{201A}\\x{2039}\\x{203A}\]', '\\x{2018}' );
    theChangeGrep ( '\[\\x{0022}\\x{201D}\\x{201E}\\x{00AB}\\x{00BB}\]', '\\x{201C}' );
    theChangeGrep ( '\\x{2018}', '\\x{0027}' );
    theChangeGrep ( '\\x{201C}', '\\x{0022}' );
    function theChangeGrep ( f, c)
    app.findGrepPreferences.findWhat = f;
    app.changeGrepPreferences.changeTo = c;
    myRange.changeGrep();
    It takes some more search executions, that's true.
    But it's language sensitive! ;-)
    After all, apostrophes () will disturb the changing also in this approach, because they are not recognized as apostrophes but as single typographical quotes.
    To prevent from this I am still looking for a solution.
    Martin

  • CS6: Object Find/Change-Stroke weight?

    Hi all,
    First time using the find/change Object query in CS6.
    I'd like to search for and decrease a specific stroke weight on all frames in my document (in this case they are all graphic frames, but I'm unable to get it to work)
    I've tried searching for all frames, text frames, graphic frames, within the Document, but the query is not finding any of the bad strokes. (I watched a Lynda.com tutorial and it looked so easy, but I can't figure out why it isn't searching for them. (none of the objects are locked)
    Is there an attribute I need to uncheck in the Find Object Format Options to ensure it only searches of the stroke? Thanks for any input.
    Here's an example:

    Thank you! That worked.

  • CS3 Find/Change Correction

    Fellow Scripters--
    In several places in the Scripting Guide, I set the find/change options to nothing. This is an error. Setting the find/change
    preferences to nothing works; setting find/change
    options to nothing doesn't. It doesn't produce an error message, but it can mess up all subsequent find/change operations.
    The affected objects are:
    AppleScript
    find change text options
    find change grep options
    find change glyph options
    JavaScript
    findChangeTextOptions
    findChangeGrepOptions
    findChangeGlyphOptions
    VBScript
    FindChangeTextOptions
    FindChangeGrepOptions
    FindChangeGlyphOptions
    Do not set any of the above to nothing, NothingEnum.nothing, idNothingEnum.idNothing, null, undefined, or anything similar.
    If you are using the FindChangeByList example script, you might want to remove the lines that do this--I'll get a revised version posted soon. The installed version works fine with the default FindChangeList.txt file, but will cause problems if you try to use more complex grep expressions.
    Thanks,
    Ole

    Here is the version of the script for CS4 (it works in CS3 as well, much better than original CS3 version).
    http://forums.adobe.com/servlet/JiveServlet/download/2080627-12695/FindChangeByListCS4.zip
    You can also use Martin Fisher's script to record settings from Text and GREP tabs, then copy and paste them to FindChandgeList.txt file.
    http://www.kasyan.ho.com.ua/downloads/RecordFindChange_CS3_Kas.zip
    Check out also this script: http://www.kasyan.ho.com.ua/find_change_by_queries.html
    Kasyan

  • Applescript find/change problem

    I have some text which needs to be styled in InDesign CS4 which has a bunch of extraneous tags ( eg. <b>, <i>, etc.). I have customised the FindChangeList.txt file that supports the FindChangeByList.applescript file to do things like:
    {find what:"<i>"}
    {change to:"^S"}
    which can then be picked up by a nested style. All good so far.
    Problem: the applescript will just not 'see' the strings <b> or </b> in FindChangeList.txt. It treats them like they aren't there. I can do it using the find/replace within InDesign, it works fine there, but my problem is that I have hundreds of pieces of copy to import and I'd like to automate as much as possible. Using GREP has the same effect, ie. works in find/replace within InDesign, but not with applescript.
    Any help would be greatly appreciated as this is really killing me at the moment. Thanks!
    Content of FindChangeList.txt follows. The command in the final line works, the command in the second-last line doesn't.
    (FYI the second line of code contains 'InDesign CS3' regardless of whether I use CS3 or CS4. I guess they didn't update the file)
    --FindChangeList.txt
    --A support file for the InDesign CS3 AppleScript FindChangeByList.applescript
    --This data file is tab-delimited, with carriage returns separating records.
    --The format of each record in the file is:
    --findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    --Where:
    --<tab> is a tab character
    --findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    --findProperties is a properties record (as text) of the find preferences.
    --changeProperties is a properties record (as text) of the change preferences.
    --findChangeOptions is a properties record (as text) of the find/change options.
    --description is a description of the find/change operation
    --Very simple example:
    --text          {find what:"--"}          {change to:"^_"}          {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}          Find all double dashes and replace with an em dash.
    --More complex example:
    --text          {find what:"^9^9.^9^9"}          {applied character style:"price"}          {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}          Find $10.00 to $99.99 and apply the character style "price".
    --All InDesign search metacharacters are allowed in the "find what" and "change to" properties.
    text          {find what:"<b>"}          {change to:"^S"}          {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}          Find all bold and replace with non-breaking space.
    text {find what:"<i>"} {change to:"^S"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find all italics and replace with non-breaking space.

    You probably should post this in the ID Scripting forum. Here's an example of some simple AppleScript find and changes that might help:
    --find and replace keyboard formating
    tell application "Adobe InDesign CS5.5"
         --first clear the preferences
         set find text preferences to nothing
        set change text preferences to nothing
        --replaces non breaking space with space
        set find what of find text preferences to "^s"
        set change to of change text preferences to "<0020>"
        set myFoundItems to change text
        --replaces soft return with return
        set find what of find text preferences to "^n"
        set change to of change text preferences to "^p"
        set myFoundItems to change text
        --replaces return space with return
        set find what of find text preferences to "^p<0020>"
        set change to of change text preferences to "^p"
        set myFoundItems to change text
        --replaces 2 returns with return
        set find what of find text preferences to "^p^p"
        set change to of change text preferences to "^p"
        set myFoundItems to change text
        --replaces return, tab, return with return
        set find what of find text preferences to "^p^t^p"
        set change to of change text preferences to "^p"
        set myFoundItems to change text
        --replaces space, return with return
        set find what of find text preferences to "<0020>^p"
        set change to of change text preferences to "^p"
        set myFoundItems to change text
        --replaces space, space with space
        set find what of find text preferences to "<0020><0020>"
        set change to of change text preferences to "<0020>"
        set myFoundItems to change text
        --replaces 3 tabs with tab
        set find what of find text preferences to "^t^t^t"
        set change to of change text preferences to "^t"
        set myFoundItems to change text
        --replaces 2 tabs with tab
        set find what of find text preferences to "^t^t"
        set change to of change text preferences to "^t"
        set myFoundItems to change text
    end tell

  • Finding changes in an object

    Hi Gurus,
    Please let me know how to find out what exact changes has been done on a object in the system. For example, if changes are done in a infopackage or a transformation, how do we know what are the exact changes that are made. Please let me know.
    Regards,
    Rajesh.

    Hi Rajesh,
    I do not think there is any method to find out what exactly changes has did in infopackage or any object...you can find out what date you have changes object, no of transport request etc...If you want to find out changes then before transport you can compare the objects with next system means you have made changes in development system and you want to findout what changes then comare same object with quality..
    still wait for other's suggestion
    Hope it will help.
    Regards,
    Ganesh Bothe

  • Find/Change problems within a nested style?

    I have a problem with Find/Change (in both CS4 and CS5) not recognizing text within its “find” parameters when text that fits those parameters is part of a nested style. I want to find any instance of italic in the text, regardless of what paragraph or character style it is, but F/C only intermittently finds italics, both within and without that text existing in a nested style. Has anyone come across this issue?
    There is NOTHING different about the text that is recognized by F/C–or not recognized–that shows up in any of the panels or palettes. There are no font conflicts. I’ve replaced prefs and saved data files. If I go into the character palette and change the italic portion of the nested style to “italic” character style (it shows up in character palette as [none], even though it has a nested style), then F/C finds it for sure; but if I don’t do that, then F/C will sometimes find it, and sometimes not, and sometimes in one instance and not in another! There is no hidden formatting that shows up in story editor. I remade another nested para style with the same formatting but with varying results! Help… I’ve tried everything.

    I have a problem with Find/Change (in both CS4 and CS5) not recognizing text within its “find” parameters when text that fits those parameters is part of a nested style. I want to find any instance of italic in the text, regardless of what paragraph or character style it is, but F/C only intermittently finds italics, both within and without that text existing in a nested style. Has anyone come across this issue?
    There is NOTHING different about the text that is recognized by F/C–or not recognized–that shows up in any of the panels or palettes. There are no font conflicts. I’ve replaced prefs and saved data files. If I go into the character palette and change the italic portion of the nested style to “italic” character style (it shows up in character palette as [none], even though it has a nested style), then F/C finds it for sure; but if I don’t do that, then F/C will sometimes find it, and sometimes not, and sometimes in one instance and not in another! There is no hidden formatting that shows up in story editor. I remade another nested para style with the same formatting but with varying results! Help… I’ve tried everything.

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

    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

    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

  • Find/Change whole words in CS3

    Maybe I'm just being dense, but when I do a find/change in ID CS3 I can't find the option to search for whole words only. The default is set to ignore whole words, so I end up finding a lot of undesirable matches. My last search was for "air," so you can imagine how many false matches I got.
    This was quite obvious in CS2, but those options (including match case) seem to have moved somewhere where I can't find them.
    Any assistance would be most appreciated.
    Mark

    With your mouse, examine each of the icons under the Change field. A tooltip identifies each one. One of them is the one you want.
    Dave

  • I would like to find the object change and to move

    Thank you very much, but
    Sayfaları, tek tek sayfalarını bakacak bu script belgede (3, 5, 7, ...) işlem yok
    I would like to object all page (height and width of the rectangle is known, the text frame) to move to find and replace
    The height and width of a rectangle with known or find text frame, changing the height and width, to move to a point
    I'm glad I sent you edit scprit
    var findX, findY, changeX, changeY, moveX, moveY;
    var diyalogWindow = app.dialogs.add({name:"RECTANGLE oR TEXT FRAME", canCancel:true});
    with(diyalogWindow){
      with(dialogColumns.add()){
    with(borderPanels.add()){
    with(dialogColumns.add()) {
    staticTexts.add({staticLabel:"FİND X"});
                         findX = textEditboxes.add({editContents: "10"});
                        staticTexts.add({staticLabel:"FİND Y"});
                          findY = textEditboxes.add({editContents: "10"});
    with(dialogColumns.add()) {
         staticTexts.add({staticLabel:"CHANGE X"});
                          changeX = textEditboxes.add({editContents: "50"});
                          staticTexts.add({staticLabel:"CHANGE Y"});
                          changeY = textEditboxes.add({editContents: "60"});
             with(dialogColumns.add()) {
         staticTexts.add({staticLabel:"MOVE X"});
                          moveX = textEditboxes.add({editContents: "100"});
                          staticTexts.add({staticLabel:"MOVE Y"});
                          moveY = textEditboxes.add({editContents: "10"});
    if(diyalogWindow.show() == 1) {
    var myDocument=app.activeDocument;
    var p;
    for(p=0; p < myDocument.selection.length; ++p) {
            myDocument.selection[p].move([changeX.editContents,changeY.editContents]); // ................... how contined ???

    https://forums.adobe.com/message/6714843#6714843
    this script
    app.selection  .paragraphs.everyItem (). spaceAfter = 1
    its make spaceafter = 1
    but how make
    1
    2
    3
    4
    5
    Each click, I get a continuous increase
    2014-09-04 12:14 GMT+03:00 vandy88 <[email protected]>:
        I would like to find the object change and to move  created by vandy88
    <https://forums.adobe.com/people/vandy88> in InDesign Scripting - View
    the full discussion <https://forums.adobe.com/message/6700008#6700008>

Maybe you are looking for

  • Problem with forwarding to new page in jsf

    Hi I am facing a problem. I have a checkbox in my jsp page and 3 submit button. The two button works w r t check box and its woking fine. I am getting problem with the 3rd button. I want to fwd to next page once the button is clicked. For the check b

  • Label "Customer" shows in Activity Clipboard shows both Customer & Contact

    In CRM 4.0 we were able to enhance this so contact record would show as 'contact' instead of  'customer' in the activity clipboard. In 5.0 this seems harder to do.  Have played with config & development but no luck so far. Any thoughts on how to achi

  • WD Portable Hard Drive Won't Mount

    This is the second time I have had a portable hard drive that suddenly quits mounting on the mac. First, a Lacie, and now a WD. After working with apple support and trying everything I could never get the problem fixed with the Lacie. Luckly, when I

  • FCP 5 universal

    i have read apples site on universal software. straight to the point, which of the universal upgrades do i need to buy to get my DVD Studio 4, Motion 2 and Final Cut 5 powermac versions to work on my MacBook Pro with Intel processor. will the 199 DVD

  • Could not render the database - File is already open in another application - Fireworks unusable

    I'm using CC for mac and when trying to export an image in Fireworks I get this message popping up- It's constantly happening and even if I click ok or press the escape button I get a repeatedly blank version of the popup and I'm unable to export the