InDesign Applescript创建具有多种字体的文本框架

时间:2018-09-28 23:18:59

标签: applescript adobe-indesign

我正在尝试创建一个Indesign applescript,该Applescript可以制作文本块,将文本放置在文本块中,并将属性应用于文本。挂起的是该框中的某些文本需要应用不同的字体。第一部分是Arial字体中的“ FullName,Business,AddressLine1,City and State和Zip。长字母字符串必须使用条形码字体(USPSIMBStandard)。不幸的是,所有这些都必须位于同一文本框中。< / p>

这是我正在使用的代码,但我无法使其正常工作,我希望有人知道如何实现这一目标。

谢谢。

tell application "Adobe InDesign CC 2018"
activate

-- Create a new document 
set newDoc to make document

-- setup dimensions for new document (adjust for page size)
set horizontal measurement units of view preferences of newDoc to inches
set vertical measurement units of view preferences of newDoc to inches
set page width of document preferences of newDoc to "8 in"
set page height of document preferences of newDoc to "5 in"
set facing pages of document preferences of newDoc to false
zoom window 1 of newDoc given fit spread

end tell

tell application "Adobe InDesign CC 2018"
set myAddressBlock to make text frame with properties {geometric bounds:{5 - 2.5, 8 - 3.61, 5 - 1.25, 8 - 0.61}}
set text of insertion point -1 of myAddressBlock to ("Full Name" & return & "Business" & return & "Address Line 1" & return & "City, State ZIP Code" & return)
set properties of parent story of myAddressBlock to {applied font:"Arial", font style:"Regular", point size:11, leading:auto, justification:left align, left indent:0.0, hyphenation:false}
set myBcode to ("DDTTTAFDAFAAFFDADDTAFTTTFFAFADATFTFFTADTTFFTTADATTDATATDDTFAAFFDA") as string
set text of insertion point -1 of myAddressBlock to {content type:text type, contents:myBcode, applied font:"USPSIMBStandard    Standard", point size:16, left indent:0.0, justification:left align}

end tell

0 个答案:

没有答案