[CS3 / VBS]  Search in CS3

I have another old script I'm updating for CS3. This one uses the "Search" function and CS3 doesn't like it, what would be my best option to replace this line with since I'm not having very good luck with it?
If TextFrame.Tables.Item(1).Cells.Item(CellCounter).Characters.Count > 0 Then
TextFrame.Tables.Item(1).Cells.Item(CellCounter).Search vbCr, False, False, " "
End If
Thanks in advance!

Hi bstimpson,
Try something like this:
Rem Given a reference to InDesign "myInDesign"...
Rem Clear the find text preferences
myInDesign.FindTextPreferences = idNothingEnum.idNothing
Rem Clear the change text preferences
myInDesign.ChangeTextPreferences = idNothingEnum.idNothing
Rem Set the "find what" property to a return
Rem (using the InDesign metacharacter).
myInDesign.FindTextPreferences.FindWhat = "^p"
Rem Set the "change to" property to a space.
myInDesign.ChangeTextPreferences.ChangeTo = " "
Rem Do the find/change operation.
TextFrame.Tables.Item(1).Cells.Item(CellCounter).ChangeText
Rem Reset the find/change preferences
myInDesign.FindTextPreferences = idNothingEnum.idNothing
myInDesign.ChangeTextPreferences = idNothingEnum.idNothing
Thanks,
Ole

Similar Messages

  • [CS3 / VBS] Groups in CS3

    I've converted over a few scripts that used to work fine in both CS and CS2.
    One particular scripts extracts text from tables on multiple textframes that include tables. After changing over to CS3 with this script, it does not extract any of the text from textframes/tables that has been grouped with other objects (for example images and other text frames).
    My question is there a way I can have the script ungroup items prior to running the rest of the script or is there any easier way than rewriting the whole script to include groups?
    Thanks!

    You don't need to ungroup the groups: use AllPageItems property of Group object. See posts 3 and 4 here – http://www.adobeforums.com/webx?128@@.59b6848b
    Kasyan

  • CS3 keyword search bug

    Doing a keyword search in CS3, Bridge does not find most keyworded images I created in CS2. It may come up with 10 images. Just as I did in CS2, I go to Edit>Find>Keyword name>equals>If all criteria are met>check all subfolders. Has anyone had this problem and found a solution?
    Thanks. Peter

    Im geting the same... I tried refreshing cache etc... but no avail...

  • Upgrade from CS3 Design Premium to CS3.3

    I downloaded the upgrade file and ran it, which de-installed Acrobat Pro 8 and installed Acrobat Pro 9. This went off without a hitch, so that's good. Is that it for the upgrade? I remember there being much more to do with the CS2.3 upgrade.

    I don't understand why is it so difficult for some to find out what CS3.3 includes. When you click on the link to it from the main page you get an Adobe Store page which clearly states:
    "Combines Adobe InDesign® CS3, Photoshop® CS3 Extended, Illustrator® CS3, Flash® CS3 Professional, Dreamweaver® CS3, and new Acrobat 9 Pro, and also includes Adobe Bridge CS3, Version Cue® CS3, Device Central CS3, and now Fireworks CS3."
    So what's the problem? All this information is very easily accesible and very clear.

  • Make Searching in CS3 Bridge more like searching within Photoshop Album

    For example, in Photoshop album if I wish to see photos that contain BOTH "Tag1" and "Tag2", I click on these two tags and only those photos that contain BOTH of these tags appear.
    In Bridge CS3 if I click "Keyword1" and "Keyword2", I see every photo that contains all of these individual keywords. What if I only want to see those photos that contain BOTH "Keyword1" and "Keyword2"?
    Please make seraching within CS3 Bridge more like Photoshop Album.

    If you click on the match box "all criteria met" seems like that should work as you want.

  • TextFrame Object CS3 [vbs]

    Good Morning all, I'm trying to access the Textframe object in CS3. I've noticed that there is a "Textframes" object which seems straight forward to access and there is plenty of documentation on the next and in Scripting Guides.
    However I cannot find any examples, tutorials or guides in how to access the "Textframe" object.
    can anyone help please?

    hi
    Set myTF = myStory.TextFrames.Item(1)
    gives you first TF of Story
    Set myTF = myDoc.TextFrames.Item(1)
    gives you first TF in Document
    Set myTF = myChar.ParentTextFrames.Item(1)
    gives you parent TF of character - works same way for all text objects - Line, Word, Paragraph, Text, TextColumn, InsertionPoint - even if your text is in Cell - doesn't work in ID 2.0.2
    Set myStory = myTF.ParentStory
    if you want to get parent Story
    robin
    www.adobescripts.co.uk

  • [CS3 / VBS]  TextFrame Problem

    So one of the old scripts I have revised to work for InDesign CS3 has a small problem.
    The script basically converts text into a table w/ some coloring options and so on. The problem is if I run the script with parts of the textframe not showing then it will only format the visible text. If I expand it and show the whole frame then it will work.
    Is there a quick option that I can throw in the code that will include all contents of the textframe so they are all converted correctly without expanding the frame?
    Thanks in advance!!!

    I don't know if I know exactly how the "parent story" works. I've been thrown into the scripting and InDesign world just recently and I'm working with scripts that were previously built.
    Here is a part of the VBScript that decides the users selection, maybe someone can help in telling me how to add the story into this -
    Rem finds the applicable frame and sends it to the ConvertIt function
    Set mySelection = myDoc.Selection.Item(1)
    Select Case TypeName(mySelection)
    Case "TextFrame"
    If mySelection.StartTextFrame.Tables.Count = 1 Then
    mySelection.StartTextFrame.Tables.Item(1).ConvertToText
    End If
    ConvertIt (mySelection.StartTextFrame)'.Texts.Item(1).ParentTextFrames)
    Case "Text", "InsertionPoint"
    If mySelection.ParentTextFrames.Item(1).StartTextFrame.Tables.Count = 1 Then
    mySelection.ParentTextFrames.Item(1).StartTextFrame.Tables.Item(1).Text.Item(1).ConvertToT ext
    End If
    ConvertIt (mySelection.ParentTextFrames.Item(1).StartTextFrame.Tables.Item(1).Texts)
    Case "Cell"
    Set mySelection = mySelection.Parent.ConvertToText
    ConvertIt (mySelection.ParentTextFrames.Item(1))
    Case Else
    MsgBox "Invalid Selection"
    End Select
    End If
    I appreciate all the help!!!

  • [CS3] GREP search first ocurence only

    Hi!
    I have an alphabetical list:
    Asdfg
    Awert
    Bsdfg
    Bwsd
    Csdfg
    Cwsd
    etc
    Is it possible to grep search first occurrences of A:s, B:s, C:s etc and then apply some formatting?
    ie search first line that starts with A, apply formatting, ignore following lines witch start with letter A and search first line that starts with B, apply same formatting...
    Thanks

    Oh allright, this one sets the paragraph style "Index head" as well.
    nextpar = app.activeDocument.selection[0].paragraphs[0];
    do
    nextletter = nextpar.contents[0].toUpperCase();
    nextpar.insertionPoints[0].contents = nextletter+"\r";
    nextpar.insertionPoints[0].appliedParagraphStyle = "Index head";
    while (nextpar.contents.length > 0 && nextpar.contents[0].toUpperCase() == nextletter)
      if (nextpar == nextpar.insertionPoints[-1].paragraphs[0])
       exit(0);
      nextpar = nextpar.insertionPoints[-1].paragraphs[0];
    } while (nextletter < "Z");
    It's surprisingly slow, on a 3 column/4 page index... but it still beats doin' it manually, 'cause you can sit back and clean your fingernails or something like that.

  • CS3: grep search to replace part of a string

    Can I do a grep search for a string of text but only replace a portion of the string while leaving the remainder intact?
    iMac G5, OS 10.5.5

    In addition to Eric:
    Find "some search string", Replace "some replacement string " also replaces part of the string, not touching anything...
    But the GREP search has two advantages: First, if you define formatting in the Replace field (italics, superscript, a character style), only the 'search'/'replacement' part will be affected, rather than the entire found string (as in regular search).
    The second big advantage is you can use any regular GREP single character wildcard in the 'left' and 'right' (matching-but-not-marking) parts. A few useful examples: '\d' (digit), '\l' and '\u' (lowercase and uppercase), '.' (any character), or even '[a-f]' (lowercase 'a' to 'f'). The only limitation is that you cannot use the once, zero-or-more, or once-or-more modifiers -- the strings must have a fixed length. FYI, those three modifiers are, respectively, ?, *, and +.
    This restriction does not apply to the 'middle' string, the one you are going to replace anyway -- use whatever GREP you want.

  • [CS3][VBS]Converting a CALS table to Indesign table in XML

    Hi!<br /><br />I have an xml-file with tables that I want to import into Indesign. It works fine when I use the Import CALS tables as Indesign tables in "Import options", but the problem is when I do this some emphasis elements inside the "entry" elements isn't found when I try to use XMLRules to format the emphasis elements in the document...<br />The structure of the table can be like this (in general):<br />Tabell<br />  table<br />    tblgrp<br />      tbody<br />       row<br />         <entry>Some text...<emp Type = "bold">bold text</emp></entry><br />         <entry>Some text</entry><br />         <entry>some text</entry><br />       row<br />      tbody<br />    tblgrp<br />   table<br /> Tabell<br /><br />When I import the Table as CALS tables to Indesign tables, the table structure is collapsed into just a <Tabell> element. I assume this is the reason why the <emp> element isn't found.<br /><br />I try to solve this by NOT importing CALS tables to Indesign tables. I see then that the whole table structure is intact in the structure panel and the <emp> elements are also found by the XMLRules, but the contents is not put inside a table in the indesign document. To put the table elements into a table in Indesign I use the Command: "ConvertElementToTable" but this doesnt work very well. I use it in XMLRules like this:<br /><br />Public Property Get xpath()<br />xpath = "//Tabell"<br />End Property<br /><br />Public Function apply(myXMLElement, myRuleProcessor)<br />With myXMLElement<br />.ConvertElementToTable "row", "entry"<br />End With<br />apply = False<br />End Function<br /><br />Does anyone have any experience of importing XML-tables in Indesign and formatting them? I could really need some to put the xml table into Indesign tables...Please help!<br /><br />In advance thanks!

    Hi!
    Just check the checkbox "Import CALS tables as Indesign tables" in the XML import options dialogbox. Then it should go automatically.
    The problem with this approach is that the entire table structure is collapsed to a single table element in the struture. If one want to do some xml-prosessing at row or cell level one need to to this outside indesign or not import CALS as Indesign tables. The big question is if there is some easy way to convert a CALS table to an Indesign table inside Indesign after one have imported the data and prosessed the row and cell elements...
    Hope anyone knows more than me about this....
    Anyway, mkarthic, I hope my answer helped you to import your CALS tables!:-)
    Greetings
    Pål

  • CS3, VBS, Selecting multiple text frames in a region is very slow

    Hello,
    I'm writing a script that selects a large crossword grid (19cm x 19cm), and changes the font and alignment before exporting out as an eps.
    When I run the code below, it starts off selecting the frames quickly and then gradually slows to a crawl, before being painfully slow at the end. It takes 35mins to run it on the clues grid and then the solution grid.
    Can anyone think of a way to rewrite the code so it's quicker? Or are there some settings that could be changed so it handles better? I've changed the Display Performance settings to the bare minimum, but it only has a little effect.
    Thanks for any help ... Nigel
    rem Selects grid and fixes text
    Set mySolPage = myDocumentA.Pages.Item(2)
    For myCounter = 1 to mySolPage.TextFrames.Count
    Set myTextFrame = mySolPage.TextFrames(myCounter)
    myBounds = myTextFrame.GeometricBounds
    If myBounds(0) > 35 and myBounds(1) > 5 and myBounds(2) < 240 and myBounds(3) < 210 Then
    myTextFrame.select(idSelectionOptions.idaddTo)
    myTextFrame.Texts.Item(1).AppliedFont = "Tahoma"
    myTextFrame.Texts.Item(1).fontstyle = "Bold"
    myTextFrame.Texts.Item(1).baselineShift = 0
    myTextFrame.textFramePreferences.VerticalJustification = idVerticalJustification.idCenterAlign
    myTextFrame.textFramePreferences.ignoreWrap = 1
    myTextFrame.textFramePreferences.firstBaselineOffset = idFirstBaseline.idAscentOffset
    else
    myTextFrame.select(idSelectionOptions.idremoveFrom)
    End If
    Next

    hi Nigel,
    1) move your TextFrames to separate layer - then you don't need to check Bounds
    2) turn OFF redrawing:
    Property EnableRedraw As Boolean
    Member of InDesign.ScriptPreference
    If true, enables redraw during script execution.
    3) create and use Para or Char Style - then you don't need to apply many times same params
    myTextFrame.ParentStory.Texts.Item(1).AppliedParagraphStyle = myParaStyle
    or
    call myTextFrame.ParentStory.Texts.Item(1).ApplyParagraphStyle(myParaStyle,True)
    and why you have:
    else
    myTextFrame.select(idSelectionOptions.idremoveFrom)
    there is no Select command ...
    but if you have Select command somewhere before - you can iterate .Selection collection - so you don't need to check bounds
    robin
    www.adobescripts.com

  • [CS3 / VBS] jpeg export - light horzontal line in final image...

    Hello,
    I am having an issue when exporting jpegs.
    When I output at the same dpi as an image placed on my document, I am getting between 1 and 5 horizontal light-colored lines showing up on the created jpeg. If I increase or decrease the output resolution by around 10 dpi, the line goes away.
    For example, my document has a 300 dpi image on it, I export at 300 dpi, I get a light colored line horizontal through just the image on the page, not anything to the left or right of the image area. If I output a 310 dpi jpeg, everything looks fine.
    This behavior happens whether called in code or exported by hand through the InDesign interface. I have also tried exporting to pdf, and it is find - no light-colored line. Last bit of information: The images I am using are both 24 bit color tiffs and grayscale tiffs. I have not tried it yet with other file formats.
    Anybody else run into this - and if so, what can I do about it?
    Thanks!

    I think I may have found out the problem here.
    The problem areas are with the high contrast blue and red-and other areas but blue and red show the most degradation. Obviously, DV being 4:1:1 (Panasonic DVCPro, NOT the 4:2:0 of DV PAL) there is a lot of colour information missing and the blue channel always takes the heaviest losses on the DVCPro format.
    The reason we've never seen this before is because we've always used the HVX cameras for either DVCPro 50 or DVCPro HD in this particular setup. In normal DV mode we almost always use our DVX100's which do have the different colour sampling and manage to smooth over this high contrast blue and red issue because of the sampling method and other factors like lesser quality optics, CCD blocks etc.
    So, by colour smoothing the material, something which QT player appears to do by default (I'm awaiting a reply from my engineer friend at Apple to confirm this) the steppy vertical lines disappear and everything is back to normal. It doesn't matter if the material is stretched out way beyond it's original dimensions, with the colour smoothed it fixes the banding on the high contrast red and blue areas.
    So the conclusion is format/codec, using a blue screen when a green one is far better suited to DV and subject material all conspired to produce the problem.
    As for the 1024 x 576 quandry, you say it doesn't exist yet if you select the Widescreen PAL square pixel preset in AE, the frame dimensions are...naturally: 1024 x 576. We also produce all our graphics for our video's at SD at that resolution and they work a treat in FCP in the anamorphic projects.

  • [CS3 / VBS] InCatalog Question

    Does anyone here work with InCatalog? I have a script I'm trying to use - InCatalogUpdateDataUsingODBC() to pull data from an active document.
    I'm trying to look at the actual InCatalog Link Field Name (ex. PartNumber, Price, etc.) to pick which data to actually pull from. I'm not sure how to incorporate it with the UpdateDataUsingODBC().
    I'm not sure if I'm making complete sense but any help would be greatly appreciated since I'm trying to get this script done asap.
    Thanks in advance!!!

    Are you trying to make a text frame expand to fit content? I was told that there is no intrinsic functionality for doing that, though there apparently is a script out there for it. If that's what you're doing, look at the InDesign WIndows forum for reference to the script.

  • [CS3][VBS] Delete Unused Swatches ALSO clears Gradient Swatches!

    Hi Folks!
    Heres another weird one. This code deletes unused CMYK swatches properly but also sets the background of some gradient swatches to black.
    myUnusedSwatches = currentdoc.UnusedSwatches.Count
    For myLoop = 1 To myUnusedSwatches
    On Error Resume Next
    Set myUnusedSwatches = currentdoc.UnusedSwatches.Item(1)
    *** I even through this in as a last ditch solution, but it only works sometimes***
    if instr(lcase(currentdoc.unusedswatches.item(1).name), "gradient") = 0 then
    myUnusedSwatches.Delete
    else myUnusedSwatches.Save
    end if
    Next
    Any ideas?

    I think i've gotten to the bottom of this - the designers have been using 'Paper' as a white background for gradients. When a colour swatch with CMYK 0 is used, the script works.
    If TypeName(currentdoc.UnusedSwatches.Item(1)) = "Gradient" Then
    Doesn't work, unfortunately, because its not actually deleting the gradient, its setting its background colour to black; the unused swatch its deleting is actually a color swatch.
    Since there will be a lot of files here set up this way, can you think of any way to work around this? Why does this not happen when you do the same action in the UI ('select all unsused'> 'Delete')?
    Thanks again Ole!
    Adam

  • CS3, VBS, Reset zero point

    Greetings,
    How do I reset the zero point to be 0,0 - ie relative to the top left corner of the document, in VBScript? In InDesign you double-click the top left box of the ruler.
    I found the below but have given up guessing how to apply it ...
    Property ZeroPoint As Variant
    Member of InDesign.Document
    The ruler origin, specified as page coordinates in the format [x, y]. as Array of 2 Units (Doubles or Strings)
    Thanks,
    Nigel

    try:
    myDoc.ZeroPoint = Array(0,0)
    (0,0) is always in top-left corner of Spread
    robin
    www.adobescripts.com

Maybe you are looking for

  • Mail not showing embedded images

    This problem has been bugging me for a while. I am getting some emails (from my company communications) that are incorrectly formatted by Mail. I see big boxes labeled "Missing Plug-in". The rest of the text is there, but those big boxes make the mai

  • HOW TO remove nodes add nodes dynamically create objects branchgroup

    After much trial and error, frustration and reading this forum I have come across a good way to dynamically add/remove objects. This is working in my model with 1.3 and jdk 1.4.1_02 Sorry if its sloppy. Here goes: Adding objects (cap bits may not be

  • Mapping of NSString to int using what? NSDictionary?

    I need to read say (for example) 100 million words from text files and count how many times a word appears over those text files. If I use NSString -> NSNumber, I end up having millions of NSNumber objects as I increment the count for each word. We r

  • Can't open Mail Merge Manager Window in Word

    I'm using Word 2011 for Mac Version 14.2.5 on Macbook Pro OS10.8.2 and I when I open a Word document and Click on "tools" menu and drop down to click on "Mail Merge Manager", the Mail Merge Manager window will not open. Can anyone help me with this? 

  • Default Group Policy - Custom policies don't apply?

    We have some computers in TEST OU with password lockout after 4 attempts but it doesn't work.  If we disable the Default Group policy in the domain controller then it works. With the Default Group Policy enable, we run RSOP.exe and it does show the c