Append/Load or export 1 character style to selected ID docs.

I would like if possible to automate this task. I want to select a group of Indesign docs & import 1 character style called Moon from the source document. So far what I have is the looping thru different ID docs can anyone guide me? I can see in the ID dictionary that is possible but I’m still learning don’t how to put it together:

set source_folder to choose file with prompt "Select folder containing InDesign Docs to import character style" with multiple selections allowed without invisibles

tell application "Finder" to set item_list to every item of source_folder

--loop thru all ID docs
repeat with this_item in item_list
	set doc_kind to kind of (info for this_item as alias)
	if doc_kind contains "Indesign" then
		tell application "Adobe InDesign CS4"
			activate
			set user interaction level of script preferences to never interact
			set myCharacterStyle to import styles
			
			--XXXXXXXXXXX The guts import Moon character style
			
			
			
			--close document 1 saving no
		end tell
	end if
end repeat

Hi,

as far as I know you can not specify a single character style to be imported by script. just a whole set.

you may collect the properties of the character style in the source and make a new one at the dest or move a textframe whose content is text formatted with the character style …

Thank U for your suggestion. I decided to create a new the style since I can’t import just 1 character style. When I run the script all docs have the character style but the font family field is blank even-thought I set up the properties to use “BSelectGlyph”. Why am I doing wrong?

set source_folder to choose folder with prompt "Select folder containing InDesign docs to which to import character style \"Moon\"." with multiple selections allowed without invisibles

tell application "Finder" to set item_list to (every item where name ends with "indd") of folder source_folder as alias list

tell application "Adobe InDesign CS4"
	activate
	repeat with DocAlias in item_list
		set doc to open DocAlias --without showing window
		tell document 1
			--create character style
try
				set myCharacterStyle to character style "Moon"
			on error
				set myCharacterStyle to make character style with properties {name:"Moon", font family:"BSelectGlyph", font style:"Regular", point size:7, leading:8, kerning method:"Optical", horizontal scale:100, vertical scale:100, baseline shift:0, skew:0, fill color:"PANTONE 2655 CV", OTF contextual alternate:false, OTF discretionary ligature:false, OTF fraction:false, OTF historical:nothing, OTF justification alternate:nothing, OTF locale:nothing, OTF mark:nothing, OTF overlap swash:nothing, OTF ordinal:false, OTF stretched alternate:nothing, OTF stylistic sets:nothing, OTF swash:false, OTF stylistic alternate:nothing, OTF titling:false, OTF slashed zero:false, OTF figure style:nothing, strike through overprint:nothing, underline color:nothing, underline gap color:nothing, underline gap tint:nothing, underline overprint:nothing, underline offset:nothing, underline type:nothing, underline tint:nothing, underline weight:nothing, underline:false, underline gap overprint:nothing}
					end try
		end tell
		--set continue numbering of every section of doc to false
		--set page number start of section 1 of doc to 1
		save doc
		delay 3
		close doc
	end repeat
end tell

Model: iMac Intel
AppleScript: 2.3
Browser: Safari 534.54.16
Operating System: Mac OS X (10.6)

hi,

CS 5.5 → font family belongs to app → font

character style: no font family in the properties
try to use: font: string, font style: string

Had a simular issue with bliss extra bold & bliss heavy; couldn’t solve it …

Hope it’ll help :slight_smile:

Got it thanks for the help:D