我有一个脚本,它通过几个段落/行并相应地应用段落和字符样式表。虽然脚本运行完美(我希望它可以帮助那里的人) - 这个过程需要太长时间 - 我可能已经走了很长一段路......我希望有人可以帮助我减少处理时间。下面是 Applescript:以及我的几行文字(原文包含 80 行)。
Quarxpress 文本:
R45m HOUSE. Landmark property with panoramic views, 2000m2 on over 8 200m2. web ref: 3036011
R35m HOUSE. Contemporary 4 bedroomed home on view slopes of Mount Street web ref: 3137609
R27.5m HOUSE. Ambassadorial 6 bedroomed home on over 5000m2 web ref: 3137592
R19.95m HOUSE. Brand new Georgian 5 bedroomed home on an acre web ref: 3057625
R19m ESTATE. Classical home of 1200m2 on 5000m2 of landscaped gardens web ref: 234336
R17.5m BOUTIQUE HOTEL. 11 Luxurious suites within a majestic setting on over 5000m2 web ref:3147123
R16.95m HOUSE. Classical 5 bedroomed home on 4127m2 in Hamilton Enclosure web ref: 3230085
R15.5m HOUSE. Georgian residence of 1100m2 close to the Country Club web ref: 737272
R13.5m HOUSE. A master-built contemporary home, amazing easterly views web ref: 3096574
R9.95m HOUSE. Renovated family home with pool and court on an acre in Bryanston West web ref: 3193537
R8.95m ESTATE. 43 on Eccleston. Packages in R8m’s. Contemporary home with views web ref: 3225098
R8.25m HOUSE. Renovated 4 bedroom home in top ave in Bryanston East on 3255m2 web ref: 3248317
R6.95m HOUSE. Nico van der Meulen contemporary masterpiece requiring final finishing web ref: 3212495
R5.95m HOUSE. Renovated 3 bedroom home in boomed enclosure on 4660m2. web ref: 3247597
R5.5m HOUSE. Prime position in boomed enclosure in Bryanston East, excellent potential web ref: 3201665
To view any of the above call Regan: 088 888 8888 or Erica: 088 888 8888
我的苹果脚本:
tell application "QuarkXPress Passport"
tell document 1
set MyStyle3 to object reference of character spec "RedCopy"
set MyStyle1 to object reference of style spec "MainCopy"
set MyStyle4 to object reference of character spec "BoldCopy"
tell story 1 of current box
set style sheet of every paragraph to null
delay 5
set ParagraphCounter to (get count of paragraphs)
repeat with n from 1 to ParagraphCounter
tell paragraph n
try
set style sheet to MyStyle1
end try
try
if words 1 thru 2 contains "." then
set character style of words 1 thru 3 to MyStyle4
else
set character style of words 1 thru 2 to MyStyle4
end if
end try
try
set character style of word 2 to MyStyle4
end try
try
set character style of words -3 thru -1 to MyStyle4
end try
try
if words 1 thru 2 starts with "To view" then
set character style of words 1 thru -1 to MyStyle3
end if
end try
end tell
end repeat
end tell
end tell
end tell
beep 3