InDesign Applescript для создания текстового фрейма с несколькими шрифтами - PullRequest
0 голосов
/ 29 сентября 2018

Я пытаюсь создать яблочный скрипт Indesign, который создает текстовый блок, помещает текст в текстовый блок и применяет свойства к тексту.Зависание в том, что к некоторому тексту в этом поле нужно применять разные шрифты.Первая часть "FullName, Business, AddressLine1, City and State и Zip в шрифте Arial. Длинная строка букв должна быть в шрифте штрих-кода (USPSIMBStandard). К сожалению, все это должно находиться в одном текстовом поле.

Вот код, который я использую, но я просто не могу заставить его работать, я надеюсь, что кто-нибудь знает, как это осуществить.

Заранее спасибо.

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
...