6 Replies Latest reply on Jan 4, 2010 9:10 AM by CTC Imaging

    [JS][CS3] Break Link to Style

    CTC Imaging Level 1

      Hello everyone.

      A while back ago I wrote a script to Brake Links to Paragraph Styles and Character Styles. That was easy since you can set to false the option "Clearing Overrides" when applying "No Paragraph Style" [0] or "None" [0]. But I cannot do such a thing with objectStyles "None" [0] even when setting the options to False. Every time the TextFrames get the ObjectStyle "None". And the GUI Palette is not showing a "+" as being modified.

      It does work when using "Break Link to Style" in the GUI.

      Any help would be appreciated...

      Alex.

        • 1. Re: [JS][CS3] Break Link to Style
          AdobeScripts Level 3

          hi

           

          why do you want to do this ? so nobody else can edit this file - without extra work ?

           

          robin

          www.adobescripts.co.uk

          • 2. Re: [JS][CS3] Break Link to Style
            CTC Imaging Level 1

            Not at all. When you copy/paste elements across documents depending on how those Styles are defined differently w/ the same name, change happens. So one way to alleviate this, is to Break the Link to Style, so your copy has no styles applied. Characters & Paragraphes are handeled correctly, not the objects (Textframes included)

            • 3. Re: [JS][CS3] Break Link to Style
              AdobeScripts Level 3

              CTC Imaging wrote:

               

              Not at all. When you copy/paste elements across documents depending on how those Styles are defined differently w/ the same name, change happens. So one way to alleviate this, is to Break the Link to Style, so your copy has no styles applied. Characters & Paragraphes are handeled correctly, not the objects (Textframes included)

               

              sorry but for me the easiest/more usefull way - and even more logical way - would be to change original name before copying, by adding "_1", "_2", etc. (OSLT) at the end of name ... maybe you won't compare for changes between "original" and "copy" now - you just need to copy/paste - but who knows what you want to do with this INDD file in next few months you can always delete duplicates.

              "Plenty is no plague"

               

              robin

              www.adobescripts.co.uk

              • 4. Re: [JS][CS3] Break Link to Style
                CTC Imaging Level 1

                Yes I did think of that solution, but I am trying to keep it clean. Especially if you are doing several document input as copy and pasting into a single document. Since I am trying to doing this automaticaly (The script is assigned to the COPY command through eventListener), if I choose ONE generic name to rename to, I will run into the same issue. Of course I could scan the DESTINATION document for that GENERIC names and add a prefix (counter) to the one I am going to rename in the ORIGINAL document. But It would not work if the DESTINATION document is not open YET! And I can't do it as PASTE because I have to copy with the correct naming FIRST.

                So the best option is to break the link. So how can I emulate "Break Link to Style" in the ObjectStyles menu from the GUI???

                Alex.

                • 5. Re: [JS][CS3] Break Link to Style
                  AdobeScripts Level 3

                  CTC Imaging wrote:

                   

                  Yes I did think of that solution, but I am trying to keep it clean. Especially if you are doing several document input as copy and pasting into a single document. Since I am trying to doing this automaticaly (The script is assigned to the COPY command through eventListener), if I choose ONE generic name to rename to, I will run into the same issue. Of course I could scan the DESTINATION document for that GENERIC names and add a prefix (counter) to the one I am going to rename in the ORIGINAL document. But It would not work if the DESTINATION document is not open YET! And I can't do it as PASTE because I have to copy with the correct naming FIRST.

                  So the best option is to break the link. So how can I emulate "Break Link to Style" in the ObjectStyles menu from the GUI???

                  Alex.

                   

                  Then you should add Date&Time at the end of name of current Char/Para/Object/Cell/TableStyle

                   

                  "MyHeaderStyle" -> "MyHeaderStyle(2010-01-04 16:12:35)"

                   

                  I don't think that you can do this TWICE in the same second in two different documents I've done something like that in one of my script and I've added 2 second extra loop to be sure that "random" name can't be duplicated

                   

                  robin

                  www.adobescripts.co.uk

                  1 person found this helpful
                  • 6. Re: [JS][CS3] Break Link to Style
                    CTC Imaging Level 1

                    Nifty a "TimeStamp" will work . I am wondering if I could remove the style after pasting and replace with "none"?

                     

                    Do you know what happened to "defaultObjectStyle" & "defaultTextObjectStyle" from CS2? Or if we can Script the Default of Object Styles for "Basic Graphics Frame" & "Basic Text Frame", equivalent of dragging the icons to "None" in the GUI?

                     

                    Thanks, Alex