[CS4 - JS]Export stories and "object is invalid" error

Hello all,
I need a javascript script that exports all the stories of a document to .icml files.
At the moment I've come to a function like this:
function exportICML(myDoc, path) {
        var stories = myDoc.stories;
for (var i = 0; i < stories.length; i++) {
      alert(i);
      var story = stories.item(i);
      var filename = path + "/story-" + i + ".icml";
      try {
           story.exportFile(ExportFormat.INCOPY_MARKUP, new File(path));
             } catch (err) {
alert(err.message);
This function fails, and in the server log I see this error:
"Object is invalid"
What am I doing wrong?
Thanks.

Works fine here :S
var myDoc=app.activeDocument;
var myPath = Folder.desktop+"/test.icml";
exportICML(myDoc, myPath);
try storing theend of loop outside the function and renaming var to avoid DOM names collision.
function exportICML(myDoc, path) {
        var allStories = myDoc.stories;
var iMax = allStories.length;
for (var i = 0; i < iMax; i++) {
      alert(i);
      var myStory = allStories.item(i);
      var filename = path + "/story-" + i + ".icml";
      try {
           myStory.exportFile(ExportFormat.INCOPY_MARKUP, new File(path));
             } catch (err) {
  alert(err.message);

Similar Messages

  • Receiving "The HR object is invalid" error in OSB

    Our HR person is encountering "The HR object is invalid" error after entering employee name while navigating to the non-flex form in OSB. She was unable to datetrack back to 4/10/10 and enter a change to the employee's enrollment, but was able to enter it using sysdate (5/14/10 at the time of entry). She really needs to enter it on 4/10 however, since the employee had a promotion to director level at that time and benefit eligibility changed as of that date. After receiving the error, the enrollment data does not display. Only option is to back out of the form. Any help would be appreciated.

    Hi,
    What is the applcation release?
    Please see if these documents help.
    Note: 335807.1 - 'HR Object Invalid' Error When Creating Enrollment In Non Flex Enrollment Form
    Note: 259335.1 - Saving Enrollment Changes Results in Error APP-PAY-07155
    Note: 338662.1 - APP-PAY-7155: The HR Object Is Invalid Error When Backing Out Of A Life Event
    Note: 462780.1 - Error In Updating FSA Amount Within Open Enrollment Period
    Thanks,
    Hussein

  • HT4993 i am trying to install msnbc app from the app store and keep getting an error message.  The app will not install.  What can i do?

    i am trying to install msnbc app from the app store and keep getting an error message.  The app will not install.  What can i do?

    This is asked and answered many times each day.  The forum search bar is on the right side of this page.
    Disable your firewall/security software and try again.

  • I am trying to export photos and keep receiving an error message. I tried relocating my catalog to see if that would help since I am saving to an external drive, but now I can't find my catalog at all either.

    I am trying to export photos and keep receiving an error message. I tried relocating my catalog to see if that would help since I am saving to an external drive, but now I can't find my catalog at all either. I am a newbie at this and don't know what I'm doing wrong or if I can even use an external drive for my photos and catalogs (I did enable smart previews so I do know how to do that part). Help!

    You can use an external drive with LR but I recommend only using it for
    image file storage while keeping your catalog on your internal HD for
    performance. If you moved files outside of LR (Finder or Explorer) you will
    have to clue LR in on where they are now. Use the left-hand folder panel in
    Library mode to navigate to the location on your external drive and use the
    find photo option get LR to reconnect them. If you moved the catalog and
    now LR can't find it you should get a window allowing you to select a new
    one where you can navigate to the new location and select it. You can also
    just start LR by clicking on the Lightroom 5 catalog.lrcat file to open it
    and start LR.

  • TS1424 i am trying to purchase something from itunes store and am getting an error has occured (-1202)  try again later

    i am trying to purchase something from itunes store and am getting an error has occured (-1202)  try again later what do i do?

    Check out this thread >  Error -9812 and -1202: Apple Support Communities

  • Good afternoon. I want to buy the program in the app store and will generate an error please contact the itunes support to complet the this transaction Previously everything was OK

    Good afternoon. I want to buy the program in the app store and will generate an error please contact the itunes support to complet the this transaction
    Previously everything was OK

    You're going to have to contact iTunes support, as directed, to fix this issue.

  • I am trying to subscribe to Adobe Export PDF and get a page error.

    i am trying to subscribe to Adobe Export PDF and get aage error on the site.

    Hi there!
    Are you certain that the serial number is for InDesign? And the correct version?
    Please feel free to PM me if you wish to verify the serial number.
    Thanks,
    Amy

  • I'm trying to purchase something from the App Store and it keeps saying Error, try again later. Why is this happening?

    Somebody please help. I've been trying to purchase Logic Pro for the longest time and my App Store keeps saying, Error try again later. It's really bothering me. I need Logic Pro immediately and the App Store refuses to cooperate with me.

    Restart your computer and try again
    never hurts to try. ha

  • Object Class Invalid when downloading the pricing procedure from ECC to CRM

    Hi,
    I want to download the pricing procedure for that I have created the ZDNL_CUST_CND which contains only the following tablesT683, T683S, T683T and T683U.
    When I check in R3AM1 status is Red.
    The following Error have been found in SLG1
    •     Object class invalid
    •     Error in inbound data check
    Message no. CND_MAP120
    Diagnosis
    During the receiving inspection, serious errors were found in the consistency of the exchange object.
    System Response
    Data exchange is terminated
    •     Data exchange terminated     
    Message no. CND_MAP122
    Diagnosis
    Data exchange has been terminated due to serious errors. No exchanged data has been posted in the system.
    The following Error has been found in SMQ1
    •     R3AD_CONDITIONS     STOP
    Details of STOP
    Set by Host name: litldq; Transaction: ; Report: SAPMSSY1
    I have checked the connection, everything is perfect.
    What may be the problem?
    Thanks

    Hi,
      Please try to re-generate the adapter object (ZDNL_CUST_CND) services using trx.
    SMOGGEN
    . After this, try re-running the load.
    I assume that your CRM inbound mapping module are correctly coded. If the problem persists, try de-registering the R3AD_CONDITIONS inbound queue using trx.
    SMQR
    and then debugging the inbound queue from the same trx. after re-starting the load.
    Reward if this helps!
    Regards,
    Sudipta.

  • Backup causing issues... media object is invalide

    I posted another question in the Destop Software section, but here's the story.
    I had to install a new hard drive in my computer.  Reistalled Win7 etc.
    Reinstalled BB Desktop Manager.
    Backed up my 9800.
    After today's back up, my BBM contacts were deleted.  I posted this in the other thread.
    Now I have also discovered that I cannot send images to BBM contacts.  I took a picture, and could not send it.  I get a warning message that says "The media object is invalid' 
    What is going on with my BBM?

    Hi bbjohnm
               I have no clue why your Contacts are wiped during a device backup, But if we do a Backup of your device it will not delete any Contact list unless we do something wrong.
    If you are using BBM prior to ver. 7 then it does allow a local backup , you can backup your contacts on your media card . So when you open BBM > Press Menu key > Options > Scroll to Backup or Restore , > You can restore if you are using that option to backup locally.
    Regarding your issue with sending Images through BBM, Are you unable to send Images or that Send Option is not available . Related to the error that you are getting while sending Images :
    KB28033 :  "Media object is invalid" error when trying to send picture to a BlackBerry Messenger contact.
              Try this KB and see if that help in resolving your issue or do a local backup of your BBM Contact that you have currently, then try Updating to BBM6.2 , TO do that from your BlackBerry browser browse to or Click here
     http://mobileapps.blackberry.com/devicesoftware/entry.do?code=bbm6 to download BBM6.2 
    So please try it and let us know of your progress.You can also Update to BBM 7 if you want .
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • I try to search in itunes store and keep getting a runtime error R6025 - help!

    I keep trying to search for music in the itunes store and I get runtime error R6025 then itunes shuts down.  Help!

    Link for the previous fix:
    http://support.apple.com/kb/HT2292
    Just an update that I did get the error once after the fix but now seems to have gone away completely. All I did after the error recurred was to add a new desktop shortcut and run as administrator. I then deleted the shortcut and went back to my usual quick access icon in the taskbar.
    Hope this helps.

  • Trying to log into App store and keep getting "An unknown error has occured" please help

    I keep trying to log into the App store and get "An unknown error has occured"  help!!

    Im having the same issue cant purchase anything.  must be down

  • Re: [SunONE-JATO] Re: Using an object to store and display data

    Personally, I think there is little or no value to creating a "domain"
    object that itself relies on a JATO QueryModel internally, but hides that
    fact and requires use of BeanAdapterModel.
    It would be more appropriate (and much less work, and more scalable) to just
    derive a QueryModel subclass and add the domain-specific behavior to the
    model. In other words, what's the point of creating an object that hides
    JATO inside it when you're running in JATO to begin with? Now if the domain
    object were doing plain JDBC, and thus trying to be JATO independent, that
    would be different. However, you could still implement the Model interface
    on the object (or use BeanAdapterModel) to integrate it seamlessly with the
    View tier.
    Todd
    ----- Original Message -----
    From: "grschroeder" <grschroeder@y...>
    Sent: Wednesday, July 31, 2002 12:00 PM
    Subject: [SunONE-JATO] Re: Using an object to store and display data
    Craig,
    I think it all finally makes sense. First, your assumption is
    correct regarding the process flow. The ViewBean will interact with
    a custom Javabean which will then in turn interact with a SQL Model
    to access the database. So now let me make sure I understand what I
    need to do. Basically the custom Javabean will have a method to get
    the SQLModel. I would then invoke the setValue method on the
    SQLModel and call the appropriate execute method( e.g.,
    executeUpdate, etc. ) just like I would do from a ViewBean. Does
    this sound correct?
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    Greg,
    see below...
    grschroeder wrote:
    Thanks for the help Craig. I looked at the sample code that makes
    use of the BeanAdapterModel. Basically it looks like it allows a
    view to interact with a bean the same way it would interact with
    any
    other model. That part I think I understand.
    This is correct.
    The part I'm a little
    unclear on still is how to interface this BeanAdapterModel( which
    is
    a very basic model ) that I now have with a query model toactually
    interact with the database.
    Not sure what you mean by "interface this BeanAdapterModel ... witha
    query model". Does this mean that you have a ViewBean the interactswith
    a custom JavaBean via the BeanAdpterModel wrapper, and from the
    JavaBean you are interacting with the SQL Model?
    So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)
    SQL Model > RDBMS
    That's what I am reading anyway. Please explain this to me.
    Would I need to make direct JDBC calls
    from my custom model instead of letting JATO dynamically create
    the
    calls for me?
    If my assumptions above are correct, then the custom JavaBean cansimply
    use the SQL Model in exactly the same manner as the ViewBean,otherwise,
    if no SQL Model is involved, then yes, you need to handle JDBCdirectly,
    which is fine, if you do it "right" (connection pooling, result set
    handling, etc.).
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    I think the best approach would be to treat your Domain Objects
    (DO) as
    the Database (the enterprise tier) from JATO's perspective. You
    could
    create custom models that interface with our DO's and then the
    JATO
    Views could easily bind to the custom DO models just like anyother
    model. This should eliminate the need for pushing data/objectsfrom
    >
    view
    to model to database.
    There is a JATO class called BeanAdapterModel that might be just
    what
    you need, however, I am not experienced with using it. Maybe
    someone
    else on my team or in the community could better explain how to
    use
    >
    this
    class.
    craig
    grschroeder wrote:
    Venki,
    Thanks for the response. Actually, I'm not sure if I can answer
    all
    of your questions because those are some of the same questions
    that
    we're trying to answer ourselves. Basically, what we're trying
    to
    >do
    is incorporate our domain object model into the JATO framework.
    My
    thinking was that one way we could accomplish this was by
    storing
    >a
    Javabean object in the HTTPSession to represent an object in the
    domain model, and that the Viewbean and JATO Model could get and
    set
    data from there. If you have a better suggestion of how to
    accomplish this, I'm definitely open to hearing it.
    Thanks,
    Greg
    --- In SunONE-JATO@y..., Venki <heyvenki@y...> wrote:
    OK grschroeder , first let me get this straight:
    0. Are you going to pass this object to the model, or are u
    going
    >
    to pass the session object to the model?
    1. Is there any specific reason for this approach you are
    taking?
    2. Will there be a notification from the object u havementioned
    >to
    have the model persist the data?
    3. What about the reverse case, when the model refreshes the
    data,
    how are you going to refresh you object?
    4. The JavaBean Object that u are talking about, is it your own
    object or is it implementation of an existing JATO interface?
    ~Venki
    grschroeder wrote:I'm fairly new to JATO, but I think I now
    have
    >a
    basic understanding
    of how Viewbeans and Models interact. However, I want to
    incorporate
    the use of a Javabean object that will be stored in the HTTP
    session
    and will act as the connection between the Viewbean and Model
    instead
    of having the Viewbean and Model interact directly with each
    other.
    Basically I would like to have the Model set data in the object
    stored in the session so that the Viewbean can pull it out to
    display
    it. And vice versa, once the user modifies the data and is
    ready
    >
    to
    persist it, I would like to have the Viewbean set data in the
    object
    stored in the session so that the Model can pull it out to
    store
    >it
    in the database. I'm not sure what the best approach would be
    to
    accomplish this. Any help you could give would be greatly
    appreciated.
    Thanks,
    Greg
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    Service.
    Venki
    IT Solutions
    #6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006
    91-44-4925740(Home) 91-44-8212877(Work)
    * Luck is what happens when Preparation meets Opportunity.
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    Personally, I think there is little or no value to creating a "domain"
    object that itself relies on a JATO QueryModel internally, but hides that
    fact and requires use of BeanAdapterModel.
    It would be more appropriate (and much less work, and more scalable) to just
    derive a QueryModel subclass and add the domain-specific behavior to the
    model. In other words, what's the point of creating an object that hides
    JATO inside it when you're running in JATO to begin with? Now if the domain
    object were doing plain JDBC, and thus trying to be JATO independent, that
    would be different. However, you could still implement the Model interface
    on the object (or use BeanAdapterModel) to integrate it seamlessly with the
    View tier.
    Todd
    ----- Original Message -----
    From: "grschroeder" <grschroeder@y...>
    Sent: Wednesday, July 31, 2002 12:00 PM
    Subject: [SunONE-JATO] Re: Using an object to store and display data
    Craig,
    I think it all finally makes sense. First, your assumption is
    correct regarding the process flow. The ViewBean will interact with
    a custom Javabean which will then in turn interact with a SQL Model
    to access the database. So now let me make sure I understand what I
    need to do. Basically the custom Javabean will have a method to get
    the SQLModel. I would then invoke the setValue method on the
    SQLModel and call the appropriate execute method( e.g.,
    executeUpdate, etc. ) just like I would do from a ViewBean. Does
    this sound correct?
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    Greg,
    see below...
    grschroeder wrote:
    Thanks for the help Craig. I looked at the sample code that makes
    use of the BeanAdapterModel. Basically it looks like it allows a
    view to interact with a bean the same way it would interact with
    any
    other model. That part I think I understand.
    This is correct.
    The part I'm a little
    unclear on still is how to interface this BeanAdapterModel( which
    is
    a very basic model ) that I now have with a query model toactually
    interact with the database.
    Not sure what you mean by "interface this BeanAdapterModel ... witha
    query model". Does this mean that you have a ViewBean the interactswith
    a custom JavaBean via the BeanAdpterModel wrapper, and from the
    JavaBean you are interacting with the SQL Model?
    So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)
    SQL Model > RDBMS
    That's what I am reading anyway. Please explain this to me.
    Would I need to make direct JDBC calls
    from my custom model instead of letting JATO dynamically create
    the
    calls for me?
    If my assumptions above are correct, then the custom JavaBean cansimply
    use the SQL Model in exactly the same manner as the ViewBean,otherwise,
    if no SQL Model is involved, then yes, you need to handle JDBCdirectly,
    which is fine, if you do it "right" (connection pooling, result set
    handling, etc.).
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    I think the best approach would be to treat your Domain Objects
    (DO) as
    the Database (the enterprise tier) from JATO's perspective. You
    could
    create custom models that interface with our DO's and then the
    JATO
    Views could easily bind to the custom DO models just like anyother
    model. This should eliminate the need for pushing data/objectsfrom
    >
    view
    to model to database.
    There is a JATO class called BeanAdapterModel that might be just
    what
    you need, however, I am not experienced with using it. Maybe
    someone
    else on my team or in the community could better explain how to
    use
    >
    this
    class.
    craig
    grschroeder wrote:
    Venki,
    Thanks for the response. Actually, I'm not sure if I can answer
    all
    of your questions because those are some of the same questions
    that
    we're trying to answer ourselves. Basically, what we're trying
    to
    >do
    is incorporate our domain object model into the JATO framework.
    My
    thinking was that one way we could accomplish this was by
    storing
    >a
    Javabean object in the HTTPSession to represent an object in the
    domain model, and that the Viewbean and JATO Model could get and
    set
    data from there. If you have a better suggestion of how to
    accomplish this, I'm definitely open to hearing it.
    Thanks,
    Greg
    --- In SunONE-JATO@y..., Venki <heyvenki@y...> wrote:
    OK grschroeder , first let me get this straight:
    0. Are you going to pass this object to the model, or are u
    going
    >
    to pass the session object to the model?
    1. Is there any specific reason for this approach you are
    taking?
    2. Will there be a notification from the object u havementioned
    >to
    have the model persist the data?
    3. What about the reverse case, when the model refreshes the
    data,
    how are you going to refresh you object?
    4. The JavaBean Object that u are talking about, is it your own
    object or is it implementation of an existing JATO interface?
    ~Venki
    grschroeder wrote:I'm fairly new to JATO, but I think I now
    have
    >a
    basic understanding
    of how Viewbeans and Models interact. However, I want to
    incorporate
    the use of a Javabean object that will be stored in the HTTP
    session
    and will act as the connection between the Viewbean and Model
    instead
    of having the Viewbean and Model interact directly with each
    other.
    Basically I would like to have the Model set data in the object
    stored in the session so that the Viewbean can pull it out to
    display
    it. And vice versa, once the user modifies the data and is
    ready
    >
    to
    persist it, I would like to have the Viewbean set data in the
    object
    stored in the session so that the Model can pull it out to
    store
    >it
    in the database. I'm not sure what the best approach would be
    to
    accomplish this. Any help you could give would be greatly
    appreciated.
    Thanks,
    Greg
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    Service.
    Venki
    IT Solutions
    #6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006
    91-44-4925740(Home) 91-44-8212877(Work)
    * Luck is what happens when Preparation meets Opportunity.
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

  • Can I hide the Adobe Reader panel with "Export, Create and Edit PDF and Send and Store Files"? I don't use it and it takes up space

    Can I hide the Adobe Reader panel with "Export, Create and Edit PDF and Send and Store Files"? I don't use it and it takes up space

    If you just mean, can I close it, sure. In Reader XI click the Tools button to close or reopen it.

  • How come there are no hidden objects games in the South African App Store and y does safari not allow you to get it downloaded from the net. There are only games for kids in the App Store. Can anyone help

    How come there are no hidden objects games in the South African App Store and y does safari not allow you to get it downloaded from the net. There are only games for kids in the App Store. Can anyone help.  Is the South African apple ipad only for children

    Nobody here is responsible for what is or is not available in any country. I believe it is a software licensing thing.

Maybe you are looking for

  • Need to add a new View With ITS Link in it

    Hello All ,   I am Working on SAP CRM 7.0 in Marketing here in marketing We do have an Account Work Center here in account we have three views Search , Create and Report .I want to add a new view with name "XYZ" in this view i want have Logical links

  • ITunes store does not recognize my password

    Do I need a different password for iTunes Store or should it recognize my apple ID passwords?

  • Error message: The disk was not ejected properly.

    A client has this message popping up periodically, even though no mounted disks have been unplugged or switched off. All mounted disks continue to be visible and functioning. It goes away when he clicks OK, but it keeps coming back, for no apparent r

  • Swf file size

    Hey everyone.... I'm new to captivate and the whole e-learning. Needless there are a lot of new programs to learn and it's VERY frusterating. Captivate is not nearly as intuitive as many of the other adobe programs, so I'm struggling BIG TIME!!! I cr

  • How does playing track from a server mounted drive look to IT department

    How does playing a file in iTunes that resides on a mounted server drive look to IT department. I'd like to play some tracks I saved on our Xserve. It is our (Marketing) server and I am the Admin, but I was curious how the traffic looks to IT. This s