• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: INDESIGN: Duplicating Char Style from One Doc to Another
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: INDESIGN: Duplicating Char Style from One Doc to Another


  • Subject: Re: INDESIGN: Duplicating Char Style from One Doc to Another
  • From: Stan Cleveland <email@hidden>
  • Date: Fri, 05 Apr 2013 13:42:16 -0700

On Apr 5, 2013, at 12:57 PM, Rick Gordon wrote:

I'm building a script intended to take one or more GREP styles from a single paragraph style in a source document and add them to a chosen paragraph style in a destination document.

My problem, at this point, is that if the destination doc does not have a character style with the name of the applied character style of the incoming GREP style, that I have not found a successful way to import that character style (just that one, not all char styles) into the destination doc. Two unsuccessful tries  are in the last else block of the code sample, repeated here:

duplicate vCurrentSourceGrepRef to end of vDestDoc --NOPE

tell vDestDoc to set vDestAppliedCharStyle to (make new character style at end with properties (properties of applied character style ofvCurrentSourceGrepRef)) --NOPE

I know that import style is a possibility, but I don't know how to limit the styles to just one.

Another laborious possibility is to make a new style and set all properties individually, avoiding problem properties that refer back to the source doc, but that's error-prone with an object with lots of properties that might be important.

Another possibility might be to build a temp element in the source doc containing the applied character style, and cut it, then paste it into the destination doc, and then delete it. But that seems hackish.

What's the best way to approach this kind of thing?

Hi Rick,

At the moment, I'm not in a position to actually test this, but it's my understanding that you can't define AND use a reference in the same command line. You need to split it into two lines, something like this:

set propsToCopy to properties of applied character style of vCurrentSourceGrepRef
tell vDestDoc to set vDestAppliedCharStyle to make new character style at end with properties propsToCopy

Also, you should NOT pass any properties that are inappropriate in the target document, such as class, object reference, parent, and properties. Capture and pass only needed properties, such as include footnotes, etc.

No guarantees, but hope one or both of those thoughts are of help.

Stan C.
  
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: INDESIGN: Duplicating Char Style from One Doc to Another
      • From: Rick Gordon <email@hidden>
References: 
 >INDESIGN: Duplicating Char Style from One Doc to Another (From: Rick Gordon <email@hidden>)

  • Prev by Date: INDESIGN: Duplicating Char Style from One Doc to Another
  • Next by Date: Re: AppleScript-Users Digest, Vol 10, Issue 121
  • Previous by thread: INDESIGN: Duplicating Char Style from One Doc to Another
  • Next by thread: Re: INDESIGN: Duplicating Char Style from One Doc to Another
  • Index(es):
    • Date
    • Thread