[VB][CS] Bug - why myStory.Contents myStory.Texts.Item(1).Contents ?

hi
for me it is bug - but maybe there is logical explanation ...
it occurs in ID CS2 and CS4 - so probably in CS3, too
let's say we have only one TextFrame in document with contents:
Line1<enter>
Line2<#>
and run something like this (VBScript/VB6 example):
set myindi = createobject("indesign.application.cs2")
set mydoc = myindi.activedocument
set mystory = mydoc.stories.item(1)
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
mystory.insertionpoints.item(1).contents = "QQQ" & vbcr
mystory.insertionpoints.item(-1).contents = vbcr & "QQQ"
msgbox(mystory.contents)
message will be:
QQQ
Line1
Line2
QQQ
but this code:
set myindi = createobject("indesign.application.cs2")
set mydoc = myindi.activedocument
set mystory = mydoc.stories.item(1).texts.item(1)
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
mystory.insertionpoints.item(1).contents = "QQQ" & vbcr
mystory.insertionpoints.item(-1).contents = vbcr & "QQQ"
msgbox(mystory.contents)
return message with this:
Line1
Line2
QQQ
so ... why adding at end works but adding at beginning not ?
and the same behavior is for Word object - and probably for all other objects with .Texts
robin
www.adobescripts.co.uk

Hello Robin,
Looks like a VB thing: JS doesn't show that behaviour (in CS4).
Peter

Similar Messages

  • How to properly change the content of text item object

    Working in CS3 here.
    I have a collection of text item objects from a grep search.
    I want to iterate through the items and possibly change the values depending on a conditional statement.
    So say I have a collection myTextObject that contains text item objects from a GREP search
    <code>
    for (var i = 0; i<myTextObject.length; i++) {
         if (myTextObject[i].content == "myCondition") {
              myTextObject[i].content = "My New Value";
    </code>
    Once I do that, all the other content values in my collection are one byte off. So I am guessing that when the collection is created, Indesign sets a byte limit on the collection and when content is replaced, it sets everything off.
    I understand that the collection is built from the beginning of the document so possibly iterating backward would solve the problem?
    Any other suggestions here?

    yep. iterating backwards shoud help.

  • Content Areas - Viewing Text Items error

    Hi,
    Our ability to view text items within content areas has just stopped.
    We now get Error: (WWS-00000)
    with no other dialogue or entries in the logs.
    As far as I know nothing has changed.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Krish Palaniappan ([email protected]):
    Hi everyone,
    We identified the issue. I expect that a patch will be released. I'll keep you posted!
    Thanks.<HR></BLOCKQUOTE>
    Hi,
    any news on the patch yet?
    Best regards,
    ~Dietmar.

  • Sharepoint error - Search Issue - The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1).

    i see this error everywhere - In ULS logs, on site. On the site > Site settings > search keywords; I see this - 
    The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>IIS 7.0 Detailed Error - 500.19 - Internal Server Error</title> <style type="text/css"> <!-- body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;background:#CBE1EF;} code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;} .config_source code{font-size:.8em;color:#000000;} pre{margin:0;font-size:1.4em;word-wrap:break-word;} ul,ol{margin:10px 0 10px 40px;} ul.first,ol.first{margin-top:5px;} fieldset{padding:0 15px 10px 15px;} .summary-container fieldset{padding-bottom:5px;margin-top:4px;} legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;} legend{color:#333333;padding:4px 15px 4px 10px;margin:4px 0 8px -12px;_margin-top:0px; border-top:1px solid #EDEDED;border-left:1px solid #EDEDED;border-right:1px solid #969696; border-bottom:1px solid #969696;background:#E7ECF0;font-weight:bold;'.
    I am facing issues in searching, my managed metadata service is not running, search results page throws internal error. Any Idea why this above error comes.
    P.S: We use windows authentication in our environment.

    Hi IMSunny,
    It seems you have solved this issue based on your another post.
    http://social.technet.microsoft.com/Forums/en-US/aa468ab0-1242-4ba8-97ea-1a3eb0c525c0/search-results-page-throws-internal-server-error?forum=sharepointgeneralprevious
    Thanks
    Daniel Yang
    TechNet Community Support

  • Unsupported Content-Type: text/html;charset=utf-8 Supported ones are: [text

    Hi I am in trouble with JAX-WS 2.1.2M1
    I try to call my Webservice like this:
    Service service = Service.create(serviceName);
            service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, "http://spblue.liberty:8084/SPBlue/GlobalLogoutService");
    Dispatch<SOAPMessage> disp = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
            SOAPMessage message = XmlUtil.getSOAPMessageFromString(request);
            SOAPMessage response = disp.invoke(message);when my disp invokes I get following Exception which seems to as a little Problem, anyway I don�t know how to get rid of this Exception.
    com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: text/html;charset=utf-8 Supported ones are: [text/xml]
    at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:116)
    at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:280)
    at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:158)
    at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:74)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:559)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:518)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:503)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:400)
    at com.sun.xml.ws.client.Stub.process(Stub.java:234)
    at com.sun.xml.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:166)
    at com.sun.xml.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:192)
    at test.service.Logout.requestLogout(Logout.java:115)
    at test.service.Logout.main(Logout.java:149)
    ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
    JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]
    my ServiceClass is:
    @ServiceMode(value=Service.Mode.MESSAGE)
    @WebServiceProvider( targetNamespace="http://spblue.liberty:8084/wsdl/globalLogout")
    public class GlobalLogoutServiceImpl implements Provider<SOAPMessage> {
         * Web service operation
        public SOAPMessage invoke( SOAPMessage logoutRequest ){
            return logoutRequest;
    }So how can I set the Charachter set before invokikng the service.
    Or how can I change the Service to accept UTF-8.
    Well, I don�t know.
    Any help is welcome.

    Hi,
    I don't know if this can help you, but I had a similar problem while invoking a web service. Eventually, I found out that the server was returning an html error page, and not the expected xml answer.
    That's why the client code raises such an error... It means that the MIME type of the anser is text/html (for the html page) and not the text/xml type of the 'nominal' web service answer.
    You can verify this by using a proxy to intercept the http request and answer involved in this web service invocation (use Fiddler for instance). Then, you will see that the server responds by sending an html page saying that something is wrong.
    Hope this helps...
    Sam

  • Msg=Unsupported response content type "text/html; 400 Bad Request

    Hi All
    this is the excpetion that I get when I am tring to run the
    service MAnagerClient.
    whether it is a list or deploy command :
    can anybody help me?
    Exception in thread "main" [SOAPException: faultCode=SOAP-
    ENV:Protocol; msg=Unsupported response content type "text/html;
    charset=iso-8859-1", must be: "text/xml". Response was:
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <HTML><HEAD>
    <TITLE>400 Bad Request</TITLE>
    </HEAD><BODY>
    <H1>Bad Request</H1>
    Your browser sent a request that this server could not
    understand.<P>
    <HR>
    <ADDRESS>Oracle HTTP Server Powered by Apache/1.3.19 Server at
    ranaldb Port 1324</ADDRESS>
    </BODY></HTML>
    at org.apache.soap.rpc.Call.getEnvelopeString
    (Call.java:175)
    at org.apache.soap.rpc.Call.invoke(Call.java:212)
    at
    org.apache.soap.server.ServiceManagerClient.invokeMethod
    (ServiceManagerClient.java:129)
    at org.apache.soap.server.ServiceManagerClient.list
    (ServiceManagerClient.java:151)
    at org.apache.soap.server.ServiceManagerClient.main
    (ServiceManagerClient.java:237)

    Hello,
    Your message contains a an HTTP 404 error so the URL that you are trying to access is not valid.
    Can you check from a browser what is the response when you call the endpoint?
    http://server:port/wedanyservices-WedanyServicesPro-context-root/MyWebService2
    I believe that you do not have a service deployed at this URL this is why you have such response, and you cannot send another response.
    Regards
    Tugdual Grall

  • How to  get rid of "Content-type: text/html; charset=UTF-8 Set-Cookie..." ?

    Hi
    I have several applications and I am working on making some kind of APEX "SSO".
    An user is authentified in one application. Then he may go to another application. The cookie has the same name from one application to another. The session ID is preserved from one application to another : i use this kind of URL : "f?p=109:1:&SESSION.:"
    I have seen that I need to authentify automatically the user when he swap to another application. For that i have a process in the welcome page that authentify the user, using the :app_user and the password, a PL/SQL after header:
    wwv_flow_custom_auth_std.login(
        P_UNAME       => :APP_USER,
        P_PASSWORD    => :P1_PASSWORD,
        P_SESSION_ID  => v('APP_SESSION'),
        P_FLOW_PAGE   => :APP_ID||':1'
        );So far so good. User is authenticated. The problem I face is that this message appears :
    Content-type: text/html; charset=UTF-8 Set-Cookie: TELEGESTION_AUTH=-1; path=/; Location: /pls/apex/f?p=109:1How to get rid of this message ?
    Thank you for your kind help !
    Christian
    PS: My question has not been answered... I hope somebody could help me on this topic.
    Edited by: Christian from France on Mar 4, 2010 2:02 AM

    Hi
    Have you tried using "f?p=109:1:&APP_SESSION.:" instead of "f?p=109:1:&SESSION.:".
    I don't see why you need to reauthenticate if they're in the same workspace?
    Cheers
    Ben

  • SOAP Rx Adapter... 401 Unauthorized.. Content Type: Text/HTML

    Hi,
    I get 401 unauthorized error while trying to invoke Webservice using Receiver SOAP Adapter..
    I know this error is b'cos Content-type = text/html instead of text/xml... So i used the MessageTransform bean with the required parameters... I even downloaded SOAP sniffer tool (suggested by Stefan grube & the log even says content type as text/html).. But still i keep getting text/html error...
    I don't have any problem invoking from my PI Server using SOAP testing tool.. I don't have a proxy between PI & Webservice as they are in the same network. I am able to reach the webservice but is failing b'cos of 'text/html'
    I am on PI7.1. Find the screenshots of the error in the below location...
    http://picasaweb.google.com/siva.maranani/SOAP_RxAdapter#5361872782883678738
    http://picasaweb.google.com/siva.maranani/SOAP_RxAdapter#5361872786622656386
    -Siva Maranani

    >
    Siva Maranani wrote:
    > I was able to use connect to Webservice using SOAP test tool ( on PI server) using the username/password. When i tested it it was sucess (I analyzed Header params- Content-type - text/xml). When i changed it to text/html, it throws an error... (not exactly 401 unauthorized.. but a different one)
    >
    > Even after i had the module, i am still not sure why it still compalins about Content-Type Text/HTML??
    >
    > -Siva Maranani
    it seems odd that you have the 401 error throwing up.
    one suggestion, if your network has a proxy, have you given the particulars in the adapter?
    ref:
    /people/shabarish.vijayakumar/blog/2008/01/08/troubleshooting--rfc-and-soap-scenarios-updated-on-20042009

  • Linked list to string coercion doesn't use text item delimiters: bug?

    set AppleScript's text item delimiters to {"; "} -- well-known technique
    {1, -1, "c", "d"} as string -- curly braces specify a vector, delimiters work
    -- result: "1; -1; c; d"
    {1, -1, "c", "d"} as linked list as string -- if coerced to linked list, delimiters ignored
    -- result: "1-1cd"
    [1, -1, "c", "d"] as string -- square brackets specify a linked list, delimiters ignored
    -- result: "1-1cd"
    [1, -1, "c", "d"] as vector as string -- coercing linked list to vector first works
    -- result: "1; -1; c; d"

    Hello
    It appears that linked list to string coercion does not respect the AppleScript's text item delimiters which are set to list of Unicode text. (Unicode TIDs have no effects in coercion as if it were set to {""})
    I can confirm this behaviour in both AppleScript 1.8.3 (OS9) and 1.9.1 (OSX10.2.8) at hand.
    So it has been as such for a long time. Bug I'd call it.
    By the way, although this is not the point, linked list is a historical residue and of little use in real scripting. After all, it is much slower than vector with appropriate coding. So we may always coerce it to vector without losing anything.
    Regards,
    H
    Linked list to string coercion & AppleScript's text item delimiters (TIDs).
    When AppleScript's TIDs are set to list of Unicode text,
    the TIDs have no effect in coercion from linked list to string as if they were set to {""}.
    set aa to [1, 2, "a", "b"]
    --set aa to {1, 2, "a", "b"} as linked list
    set t1 to list2text(aa, ";") -- "1;2;a;b" -- in pre-AppleScript 2.0
    set t2 to list2text(aa, ";" as Unicode text) --"12ab"
    return {t1, t2}
    on list2text(aa, delim)
    list aa : source list
    string delim : a text item delimiter
    return string
    local astid, astid0, t
    set astid to a reference to AppleScript's text item delimiters
    set astid0 to astid's contents
    try
    set astid's contents to {delim}
    --set t to aa as string
    --set t to aa as Unicode text
    set t to "" & aa
    set astid's contents to astid0
    on error errs number errn
    set astid's contents to astid0
    error errs number errn
    end try
    return t
    end list2text

  • Before your Firefox Help question (Why is it that text is transposed over text when viewing certain websites. I'm running win 7 and the latest version of FF.)

    Before your Firefox Help question (Why is it that text is transposed over text when viewing certain websites. I'm running win 7 and the latest version of FF.)

    If you have increased the minimum font size then try the default setting "none" as a (too) high value can cause issues.
    *Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    Make sure that you allow websites to choose their fonts.
    *Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"
    *https://support.mozilla.org/kb/Changing+fonts+and+colors
    It is better not to increase the minimum font size, but use an extension to set the default page zoom to prevent issues with overlapping text.
    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/

  • How to change "Select a content category " text

    Hi folks,
    I really appreciate the support community, as I did deeper and deeper into the produce I've seen the same handful of names pop up across the board! Thanks for all your help!
    I was wondering how to change the "Select a content category>>" text that displays in a traditional skin next to your content categories upon generation. Specifically this:
    Is there a way to edit the text? Mine are focused on government levels and I'd like to make it easier for users.
    Thanks! Happy New Year!

    Hi there
    I believe you do it as follows:
    Click File > Project Settings.
    Ensure the General tab has focus.
    Click the Advanced... button.
    Click the LNG File tab.
    Scroll the list to the [WebHelp] section.
    Locate the item that reads: ContentCategoryList=Select a content category.
    Click on it to select it.
    Click the Edit button.
    Change the text following the equals sign it to what you want it to read.
    ContentCategoryList=Change this text
    Press Enter to accept the change.
    Click OK to dismiss the dialogs.
    Generate and test!
    Hope this helps... Rick

  • How to save the RichTextBox Content in Text file

    hI ,
    I NEED TO SAVE THE RichTextBox Content in text file ? 

    If this IS a LabVIEW question, here's an example of how to load a rich text file (to help if you don't know how to get a rich text in LabVIEW).
    If you have a Rich Text Box, you can use the invoke method "SaveFile" to match the function you linked to.

  • Why can't I text with non Apple equipment?

    Why can't I text with non Apple equipment?

    You can with third party apps. You just can't use Messages in order to text since it only works with other iOS devices and Macs running Mountain Lion.
    https://www.google.com/search?q=texting%20apps%20for%20iPad

  • Problem in copying a text item content in forms 10.1.2 to other application

    Hi all,
    I have just upgraded my Form server 6i in Windows 2003 to to Application server 10.1.2 in Linux.
    In previos version Application Users Used to Copy some texts from other Applications like Windows NotePad or Client/server Version of Application to webforms text items or vice versa.
    In Application 10g it doesnt work. whithin the webforms we can copy and past content of texts but within Applications It doesnt wirk at all.
    we are running Forms 10.1.2 on Windows XP, using windows IE as the browser.
    Does Forms 10.1.2 use its Own clipboard?
    does anybody know any workaround to solve the problem?
    thank you in advance.
    Alireza

    Hi Mark,
    Thanks for your attention,
    I Think it's not the certification mater, because in development environment I have Stand alone OC4j installed in Windows Xp witch uses the same version of Jinitiator and copy/paste functionality works fine.
    Surprisingly when I connect to application server 10.1.2 witch is installed in Enterprise Linux from the same PC the functionality does not work.
    I cheked windows clipbord before and after running the form application from and noticed that copy/paste mechanism of form doesnt effect windows clipbord ant it somehow uses a private clipboard within itself.
    Any solution would highly be appreciated.
    Thank you in advance.
    Alireza.

  • Passing contents of text file in oracle cursor

    Hi,
    I need to pass the content of text file in cursor and pass it on to calling codes. then calling codes will generate another text at their end. Can some help how can I pass contents of text file in oracle cursor? Thanks

    i need to do it without tables for some reasons.

Maybe you are looking for

  • Firefox beta will not update acrobat plug in why ?

    why does firefox beta have a acrobat plug in it will not update just goes back to the same page and says out of date  Adobe reader says it is up to date

  • One-to-many/foreign keys howto

    I have a situation where I'm trying to assemble a web of data and not make JDO mad. Here's the structure. I load this data in in batches, with an entry being placed in a load history table (H) to track each batch. Each batch contains primary (M) reco

  • Need Java API doc for the preference Manager class

    Where can I get Java Doc for the following classes import oracle.webcenter.peopleconnections.preference.Preference; import oracle.webcenter.peopleconnections.preference.PreferenceException; import oracle.webcenter.peopleconnections.preference.Prefere

  • Transport Solution Manager configuration between systems

    Hello all, I created a configuration project for service desk on spro_admin on development environment. Then configured all the basic steps for service desk. Now how can move things to quality system and then to Prodution? Is it enough to create a pr

  • I need to transfer my address book from a Sony Ericsson ...

    I need to transfer my address book from a Sony Ericsson K810i to a Blackberry 8120. Please can you help as I'm having great trouble doing it! Thanks