3 Replies Latest reply on Sep 5, 2011 12:44 PM by Harbs. Branched from an earlier discussion.


    Andreas Jansson Level 2



      What difference does snippetImportUsesOriginalLocation make?


      Using scripting, I do something like this:


      app.documentPreferences.snippetImportUsesOriginalLocation = true;

      var objToReplace = mDocument.selection[0];



      This results in the idms snippet being placed directly on top of its original place, and setting snippetImportUsesOriginalLocation to false or true seems to make no difference.


      (Even setting app.documentPreferences.snippetImportUsesOriginalLocation = false and placing a snippet that was exported from another frame than the selected one in the example above, places the snippet in its original location.)


      I have another question in regards to placing IDMS files as well:

      To replace an existing item, do you really have to do as demonstrated above, placing using an existing item, and then add another line of code, to remove the objToReplace? Or is there a way to let a snippet take the place of an existing item automatically?

      (I know, it's just one line: objToReplace.remove();)


      But to clearify: I'd like to import a snippet into the same place in a document, and if there was a way to let it land on its old place and also replace the old item, that would have been the best. But using Document.place results in a "placement cursor", so that I have to click in the document, where to put the imported IDMS frame...


      My first thought was that snippetImportUsesOriginalLocation = true would have imported and replaced in such a way when placing an idms on document level.