jjgod / blog Random notes by Jjgod Jiang.

Posts Tagged ‘appscript’

用 AppleScript 来辅助 Pages 排版

Pages 的混合语言排版功能一直为人诟病 (实际上 Pages 的多语言支持也一直很弱,甚至比不上 TextEdit),比如像组合字体 (combined font) 这样在排版软件中很常见的功能也迟迟没有提供,所以经常有人说用 Pages 排版中英文混合的文章是一种折磨。

昨天看到 Apple 版上的一篇文章,便想起来试试 Page ‘09 新增的 AppleScript 功能,其实用到的功能在之前的 Pages 版本中应该也有,不过我手头没有更早的版本,所以无法试验了。可以点这里看完整的脚本,其实核心代码非常短:

from appscript import * pages = app(id=”com.apple.iWork.Pages”)

for doc in pages.documents(): words = doc.words() i = 0

for word in words: i [...]