2014-02-07 64 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