[JS, CS3] Texts of a xmlElement

I'm having a little thing here i dont understand. I found the below code on the forum, and have modyfied it very little.
I use the script to find all xmlElements with a given name, and returning an array of the xmlElements.texts. Problem is, that for autotagged text in cells, xmlElements.texts is all text in the cell, exept for the first character, what am I doing wrong?
Please see the comments to the two alerts in the script.
function getItemsByXmlTag() {
    var xpath = ["//Cell"];
    var xmlItemMatches = getXmlMatches(xpath);
    function getXmlMatches(myXPath){
        var myXMLElements = new Array;
        var _items = new Array;
        var myRuleProcessor = app.xmlRuleProcessors.add(myXPath);
        try{
            var myMatchData = myRuleProcessor.startProcessingRuleSet(app.documents.item(0).xmlElements.item(0));
        while(myMatchData != undefined){
            var myElement = myMatchData.element;
            myXMLElements.push(myElement);
           alert(myElement.contents); //Always gives me the text contents
           alert(myElement.texts[0].contents); // Gives me the same as above, exept for all "autotagged" elements like "Cell". If its a cell containing some text, this alert gives me the text of the cell, but without the first character - what am i missing?
            _items.push(myElement.texts);
            myMatchData = myRuleProcessor.findNextMatch();
            myRuleProcessor.endProcessingRuleSet();
            myRuleProcessor.remove();
            return _items;
        catch (myError){
            myRuleProcessor.endProcessingRuleSet();
            myRuleProcessor.remove();
            throw myError;

Hmm tested the unchanged script just now, seems the problem has been eleminated after a restart.
Scratch that, the problem persist, could anyone try and run the script and tell me their results please
Message was edited by: Thomas B. Nielsen

Similar Messages

  • Indesign CS3 text frame parameters and export PDF

    could use some help with the following:
    I need to edit and export a large number (7000) Indesign documents (one page)
    1. check for locked text frames and unlock
    2. group all text frames
    3. set grouped text frames at x=8 millimeters, y 10 milimeters
    4. export the documents to PDF in a subfolder called "Out"
    5. save and close the documents in the same subfolder as an Indesign CS3 document (orig is CS2)
    This is what I've been trying soo far:
    Now only checking one text frame - should be all text frames
    "close document 1 saving yes" doesn't work because the originals are from CS2
    I get a PDF called "Adobe Indesign SC3"
    set processFolder to choose folder with prompt "Choose a folder that contains Innd Docs to process"
    tell application "Finder"
    if not (exists folder "OUT" of processFolder) then
    make new folder at processFolder with properties {name:"OUT"}
    end if
    set the destination_folder to folder "OUT" of processFolder as alias
    end tell
    tell application "Finder"
    try
    set listFiles to (files of contents of processFolder) as alias list
    on error
    set listFiles to (files of contents of processFolder) as alias as list
    end try
    repeat with thisFile in listFiles
    tell application "Adobe InDesign CS3"
    with timeout of 120 seconds
    activate
    set properties of view preferences to {horizontal measurement units:millimeters, vertical measurement units:millimeters, ruler origin:page origin}
    open thisFile
    set myDoc to document 1
    set docName to name
    tell myDoc
    set transform reference point of layout window 1 to top left anchor
    set myBox to text frame 1 of page 1
    set properties of myBox to {locked:false}
    move myBox to {8, 10}
    end tell
    export document 1 format PDF type to (destination_folder as string) & docName & ".pdf" using PDF export preset "[Drukwerkkwaliteit]" without showing options
    close document 1 saving yes
    tell application "Finder" to move thisFile to destination_folder with replacing
    end timeout
    end tell
    end repeat
    end tell
    end
    end
    Any help is greatly appreciated - Doing this manually is a lot of work!!!!!
    Peter

    You're asking for the name of the application, not the document -- you need<br />to do it after your "tell myDoc".<br /><br />You could also get the name from the alias you open, rather than the open<br />document, something like:<br /><br />repeat with thisFile in listFiles<br />set oldDelims to AppleScript's text item delimiters<br />set AppleScript's text item delimiters to {":"}<br />set docName to text item -1 of (thisFile as Unicode text)<br />set AppleScript's text item delimiters to oldDelims<br /><br />You should also move your "set properties of view preferences" line to after<br />your "tell myDoc".<br /><br />-- <br />Shane Stanley <[email protected]>

  • PS CS3 Text Tool No Spaces in OSX Lion

    Hi. I still use CS3 (sorry!) and just bought a new machine running Lion.  (Note: It's a MacBookAir and both PS and LR scream on it!)
    I transferred CS3 over using Migration  Assistant.  Seems to work fine, except the separate words in the Text Tool get run together, i.e. it does not support spaces between words.  Could this just be a "Preferences" item somewhere? Seems similar to the ol' HTML issue, except HTML even allows you for one space between words.  On PS, I get none.

    This is an issue with "Helvetica Neue Bold". See: http://kb2.adobe.com/cps/912/cpsid_91264.html
    Try another font or another facetype and it will work.

  • After Effects CS3 - Text layer bugging, goes to upper corner always

    Hi!
    I'm using AE cs3, it has worked fine but suthenly it started to do following...
    When I create a new textlayer, put it wherever on the screen and type out my text, it insist on appearing in the left upper corner. After I created it, i move the bounding box around, scale it rotate etc, the text just keeps staying there, in the top left corner slightly outside, it doesnt respond to any transformation adjusting...
    ANNOYING...
    But when I make the text layer 3d, it appears in the bounding box and is editable like normally... without 3d cam or anything. Have I by accident hit som weird switch or is it corrupted?

    To report bugs, send a detailed bug report (including information about the version number of your software, some details about your computer, et cetera) to [email protected]
    You can also submit bugs through the
    feature request form if that's more convenient:

  • Photoshop CS3 Text engine Not functioning

    Hi all,
    wonder if any of u guys here have this error ...
    whenever i tried to type text using the type tool .. it always got hang ... in turn i have to close the application ... slightly earlier ard december, there's this error msg stating something like " something is preventing your text engine from functioning." now it get slightly better but still hang when u click commit[a green tick at the top] .. ani help ??
    Thanks in advance ...

    I am experiencing this as well - plus not all of my fonts being enumerated unless they are copied (yes, I have to duplicate all my fonts) in the /program files/common files/adobe/fonts folder.
    This is seriously annoying - I don't believe the fonts are corrupted because they work in other applications including Illustrator CS3 (however it doesn't recognize all the fonts either - but at least it doesn't hang)
    This is a very serious problem.

  • FW CS3 Text bug?

    After working in Fireworks all weekend for loads of site
    navigational elements, I now have to change the font size for a
    great many entries. For some unfathomable reason, Fireworks CS3 now
    suddenly refuses to change font sizes in those documents.
    Actually, it does change size in 1 out of 5 documents (they
    are all copies of each other, in different languages).
    But only as long as I don't open any of the other 4 documents
    and try to change something there -- do that
    before I open the one working document, and it stops working
    as well. Do that
    after making changes in that one document, and it stops
    working too.
    All of these documents use the
    exact same font (same size, same colour)!
    The "helpful" warning says «Could not complete your
    request. The selection was incorrect for this operation.» and
    only appears once, unless I quit and restart Fireworks.
    Using the Editor by right-clicking into the text field,
    everything works OK.
    How can I get FW back to usable state... any ideas? Rebooting
    does not help.
    (MacBook Pro, 3GB RAM, OS X 10.4.9, Fireworks CS3)
    TIA!

    HatM wrote:
    > Problem:
    >
    >
    quote:
    ?Could not complete your request. The selection was incorrect
    for this
    > operation.? and only appears once, unless I quit and
    restart Fireworks.
    > message while trying to change text font size,
    horizontal scale, font type and
    > other features from the Text tool properties panel.
    Features available from the
    > text editor panel
    Are you sure the text hasn't been converted to paths?
    > Other Problem giving the same message: trying to ungroup
    a masked picture,
    > while not the mask was selected, but the picture.
    Check the layers panel to be sure the mask group hasn't been
    flattened.
    Linda Rathgeber [PVII] *Adobe Community Expert-Fireworks*
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/
    http://www.adobe.com/communities/experts/

  • [Mac CS3] Text Encoding of Snow Leopard

    Hi,
    I'm trying to write some multi-byte characters to a text file, but  instead of one multi-byte character,  some strange characters like this : 
         <AE40>
    This should be like this character:
         他
    This problem arise only with Mac OS 10.6(Snow Leopard). With Mac OS X 10.5(Leopard) I have no problem at all.
    Pls kindly help me with this.
    Thanks in advance!
    Kimex
    The following methods are the codes I used to write folder name to a text file.
    Method 1.
    IDFile txtFile(filepath);
    PMString myString(folderpath);   //folderpath is PMString of selected folder.
    FileUtils::NormalizeUnComposedUnicodeChars(myString);
    FILE* fh= FileUtils::OpenFile(txtFile, "wt");
    if(fh!=NULL)
         fprintf(fh, "%s", myString.GrabCString());
         fclose(fh);
    Method 2.
    InterfacePtr<IPMStream> txtFileOutStream(StreamUtil::CreateFileStreamWrite(txtFile)); 
    if ( txtFileOutStream->GetStreamState() == kStreamStateGood ) 
         FileUtils::NormalizeUnComposedUnicodeChars(myString);
         int32 len = myString.CharCount();
         char *buffur=myString.GrabCString();
         txtFileOutStream->XferByte((uchar *)buffur,len);      
         txtFileOutStream->Flush(); 
         txtFileOutStream->Close();

    I can't see your problem.
    I can write the file path including "他" character to the file in Shift-JIS.
    I have tried with my plug-in for InDesign CS4 on Mac OS X 10.5 and 10.6.
    I don't try with InDesign CS3,  InDesign CS3 isn't supported for 10.6.  (I haven't installed.)

  • ID CS3 - text wrap doesn't work at the end of a long multi-columned text frame

    Did a search - don't think this specific issue has been addressed:
    We design large graphics often used on walls. When working with a text frame that that was 11 feet long and had 8 columns, text wrap would not work on an image placed in the last column. The same image with the same text wrap applied will work fine anywhere else in the text frame. I found that if I shortened the width of the text frame a little bit at a time eventually it would work, but there doesn't seem to be a specific cut-off width - sometimes the last column won't text wrap when the frame is 115 inches wide and sometimes it doesn't work when the frame is only 80 inches wide. Again, all of the other columns work fine. I have tried all of the obvious stuff, the only variable between the columns that wrap and the one that doesn't is it's position at the end of the text frame.
    We have gotten around this issue by using multiple threaded frames instead of one long frame with multiple columns, but I am curious if anyone else has run into this or might know what the issue is.
    thanks

    Did a search - don't think this specific issue has been addressed:
    We design large graphics often used on walls. When working with a text frame that that was 11 feet long and had 8 columns, text wrap would not work on an image placed in the last column. The same image with the same text wrap applied will work fine anywhere else in the text frame. I found that if I shortened the width of the text frame a little bit at a time eventually it would work, but there doesn't seem to be a specific cut-off width - sometimes the last column won't text wrap when the frame is 115 inches wide and sometimes it doesn't work when the frame is only 80 inches wide. Again, all of the other columns work fine. I have tried all of the obvious stuff, the only variable between the columns that wrap and the one that doesn't is it's position at the end of the text frame.
    We have gotten around this issue by using multiple threaded frames instead of one long frame with multiple columns, but I am curious if anyone else has run into this or might know what the issue is.
    thanks

  • ID CS3: Text Wrap stopped working!

    I suddenly have an odd problem: a text box that refuses to honor the text wrap setting on another box. The one that is supposed to force the wrap does have the wrap turned on. The box that is supposed to honor the wrap setting is not set to ignore the text wrap.
    I've tried the common fixes like going into composition preferences and toggling on and off the "Text Wrap Only Affects Text Beneath" box, and trashing ID's preferences. In addition, I have run Onyx to repair permissions and run maintenance scripts, and in desperation also cleaned the font cache.
    I'm really stumped here. The box that the text is supposed to wrap around is an object that I keep stored in a library (a column head for a regular contributor to a magazine), and it has performed flawlessly for months. Nothing is changed in that respect from the previous issue of the magazine. The two boxes are on different layers, but that has been no problem in the past.
    I should add that the problem is not limited to that particular library item; it seems to also happen with other column heads from that same library.
    Does anyone have any hints as to where I should go from here? I'm at a bit of a loss

    Finally discovered the problem. Somehow my text box default had changed from text wrap off to text wrap on (I'm sure I wasn't paying attention at some point) and, with both text boxes set to wrap, they were somehow canceling each other out.
    Once I shut off the text wrap on the article box, everything snapped back to normal.
    (whew)

  • [JS] [CS3] Text Path to Layer?

    A Hierarchy question.
    How can I navigate from a Text Path object to find its Layer? (ie the Layer it resides on)
    Thanks,
    PJB

    Ok, what you need is:
    myTextPath.parent.itemLayer;
    The parent of the text path is the polygon (or other page item) that "owns" the path on which the textPath item sits.
    Not an oversight; just a slightly more complex object model branch than meets the eye.
    Dave

  • InDesign CS3 Text Variables

    I was wondering if anybody could help me.
    Is there a way to export to a PDF from InDesign, and the text variables still function as they would in InDesign?
    Any help would be greatly appreciated! thanks

    I don't believe that InDesign writes anything into a PDF file it creates that would allow text variables to work in the PDF. There is no concept of "text variables" in the PDF spec.

  • DW CS3 Text wrap question??

    Hello, can you guys help me figure out why the text is wrapping under these photos?  http://www.cvbcmanteca.org/ministries.htmlThe site is based on a template, but I needed to add more of the same on the page, and just went into the code and copied the code and inserted.  I thought it would have duplicated the look, but  for some strange reason, text is wrapping below the image under the "Filippino Ministry" and "fit ministry" section about middle down the page.  How do I keep it in the area to the right?
    Thanks Guys

    I'm sorry. It was late when I posted my first reply and I am dealing with a terrible cold right now so I didn't notice the error my coding took on when I posted it.
    There are two ways to prevent this:
    As stated above, you could add a number of "spaces" which read as " &-n-b-s-p-;" (without the quotes and dashes) as follows:
    ...and get involved in learn relevant lessons                                          from God's Word.
    , or add the pixels to the bottom margin of the images in the style sheet as follows:
    .category img {
         margin-right:15px;
            margin-bottom:20px;
         border:none;
         float:left;
    Hope that helps a little more. Adding the 20px to the stylesheet does the trick and is by far the easier of the two. (see attahced result)

  • AFX CS3 Text Bevel Question

    I am trying to bevel text that has a 10px stroke. I want the bevel to affect the fill and not the stroke. Is there an easy way to do this?
    Thank you!

    You could duplicate the layer and have the stroke separate while the layer with the fills only has bevel. to simplify further handling, you could possibly pre-compose. If you use text animators, you can link them across the multiple instances using simple pickwhip expressions to keep thme in sync.
    Mylenium

  • Flash CS3 text display

    Since upgrading from Flash V8, I'm having an issue where
    prominent fonts (such as Myriad Pro) appear jaggy until the file is
    published, making layout and design difficult. I've checked the
    text display settings with now change in appearance. The files do
    publish with anti-aliased text.

    quote:
    Originally posted by:
    sczulu
    Since upgrading from Flash V8, I'm having an issue where
    prominent fonts (such as Myriad Pro) appear jaggy until the file is
    published, making layout and design difficult. I've checked the
    text display settings with now change in appearance. The files do
    publish with anti-aliased text.
    I've noticed this issue as well and was wondering why I was
    having a problem, thanks for answering that question.

  • [CS3][JS]Add Tag to text

    hi,
       I need to apply tag to selected text in a layout.We can do it manually by selecting text in a layout and then choosing tag from 'Tags' window.The same thing needs to be done using Javascript.I have used the following code,but it adds tag to entire paragraph,not for selected text.The paragraph is already tagged. I need to add tag(sub tag) for selected text which is already tagged.
    app.selection[0].associatedXMLElements[0].markupTag=myDoc.xmlTags.item("subtitle");
    Please suggest me.
    Regards
    kumar

    This tags any selected text:
    app.activeDocument.xmlElements.item(0).xmlElements.add ("subtitle", app.selection[0]);
    and adds this tag to the one containing the selection (despite adding it to the 'root' of the document). It seems not to care whether the selection already is tagged -- it always adds another one.

Maybe you are looking for

  • Removable disks and multiple catalogs

    HI, I have a new system and I am wondering what my options are to get my images onto the system. I have the disks from my old system that have about 300 GB of images each. These images are divided by years so that 2 years are on one drive and two yea

  • [ADF-11.1.2] Using Pageflow scope MB in pages is throwing TargetUnreachable

    Hi, I have a BTF with one MB "TempBeanVar" Configured as pageFlow scope. I then configured created one page (.jsff) which is called in above BTF. On that page: I have created a button with actionListener = <af:commandToolbarButton text="View" id="ctb

  • WD Abap ALV - Deleting Variant

    hi folks, i have a webdynpro abap application which uses a default variant. Now i deleted some rows of the ALV table, now the application dumps as it wants to load the default variant with rows that are no longer in the alv table. does anybody has a

  • Imap email+autoretrieval hangs Messaging over time

    First, thanks to the NSU team for making the device mostly enjoyable; 3.x was a big improvement from an email perspective. Here's a serious and repeatable bug with imap: * Set up imap account, * Turn on auto-retrieve, * Show new mails on Standby scre

  • Cannot make outside call (H.323 gateway and CUCM 6)

    I cannot make outside calls. I am using H.323 gateway configuration and CUCM 6. I have attached configuration file and debug file. I configured H323 gateway and route pattern in CUCM. Please let me know if this is a configuration issue or telecom iss