2014-02-07 37 views
0

我有一个AppleScript,可将InDesign中的活动文档导出到桌面上的PDF中。将活动页面导出为PDF(AppleScript + InDesign)

--this script exports all opened InDesign document as PDFs 

set my_destination to (path to desktop) as string 

tell application id "com.adobe.InDesign" 
activate 
--next line collects all current PDF export presets 
set my_pdf_export to get the name of every PDF export preset 
--next line makes you choose which preset to use for ALL opened InDesign documents 
set my_pdf_choice to (choose from list my_pdf_export) as string 
--loop starts here 
repeat with this_doc in (active document) 
    --next line gets the name of the active InDesign document 
    set doc_name to get name of this_doc 
    --next 3 lines perform the actual PDF export 
    tell this_doc 
     export format PDF type to my_destination & (characters 1 thru -6 of doc_name) & ".pdf" using my_pdf_choice without showing options 
    end tell 
end repeat 
end tell 

脚本在导出之前会提示输入PDF预设选项。

我想脚本只导出活动文档的活动页面。

我已经试过几件事情就像活动页面”代替“活动文档”,但我不是太有见地有关AppleScript。

任何想法?

+0

是否需要成为PDF?你可以使用导出的JPEG吗? (好奇,因为我只能看到在InDesign词典中导出图像的页面范围参考) – adamh

+0

是的,必须是PDF。 – kylemclaren

回答

0

它看起来像你有你的代码This Macscripter question,并且代码已经在该脚本,你只需要设置的page range InDesign中的PDF Export Preferences

tell PDF export preferences 
    set page range to "1, 3-5" 
end tell 

只要确保将它恢复到了最后,因为这是一个persisten t应用程序设置。

tell PDF export preferences 
    set page range to all pages 
end tell 
+0

我确实发现了这一点,并为此制作了一个[Alfred工作流程](http://www.alfredforum.com/topic/3877-adobe-indesign-pdf-export/) – kylemclaren