3 Replies Latest reply on Jun 9, 2008 10:16 AM by GagnonEric

    Force the content to "non assigned"

    GagnonEric
      Hi,

      I have tried to find the scripting equivalent of setting the content of a page item to non assigned without success (Class is read only attribute by exemple).

      Any idea of where i could look for this?

      Thanks!

      Eric
        • 1. Re: Force the content to "non assigned"
          Level 1
          Non-assigned is the state that any rectangle, polygon, or oval is created in. If you place something in it or assign text to it, it ceases to be non assigned.

          You can change the contentType of an object only if it is empty. Here's an illustrative JavaScript:
          aDoc = app.documents.add();
          
          myTF = aDoc.pages[0].textFrames.add({geometricBounds:aDoc.pages[0].bounds});
          myTF.contents = "This text isn't going to last very long";
          try {
            myTF.contentType = ContentType.unassigned;
          } catch(e) {
            alert("Can't change content type when it has contents");
          }
          myTF.contents = "";
          myTF.contentType = ContentType.unassigned;
          myRect = myTF.getElements()[0];
          alert("Text frame has become a " + myRect.constructor.name);
          Dave
          • 2. Re: Force the content to "non assigned"
            GagnonEric Level 1
            "myTF.contentType = ContentType.unassigned;"

            This is what i'm looking for.. but the applescript version! :)

            I will have another look at the dictionary!
            • 3. Re: Force the content to "non assigned"
              GagnonEric Level 1
              Thanks for pointing me in the right direction!

              The property was listed after visible bounds (in the dictionary)!! [ie. the list is sorted but there is a few properties that are mixed in the end of the list.. not sure why it is so and it's the first time i notice that!)

              so it's:

              set content type of tPageItemRef to unassigned

              :)