Adobe CS6 InDesign desktop publishing software Scripting Guide

CS6 InDesign is a powerful desktop publishing software that allows you to create professional-looking documents, layouts, and publications. It includes a wide range of features and tools for creating and manipulating text, graphics, and images.

PDF
Document
Adobe InDesign CS6 Scripting Guide: AppleScript | Manualzz

Advertisement

Advertisement

/

Advertisement

Key features

  • Create professional-looking documents

  • Wide range of features and tools

  • Create and manipulate text, graphics, and images

  • Support for AppleScript

  • Automate tasks by writing scripts

Frequently asked questions

InDesign CS6 is a desktop publishing software used for creating professional-looking documents, layouts, and publications, such as brochures, magazines, and books.

Yes, InDesign CS6 supports AppleScript, which allows you to automate tasks and create custom workflows.

This scripting guide provides detailed information on how to use AppleScript with InDesign CS6. It includes examples and tutorials to help you get started.

User questions

V H

John V.

How to extract all pages' text in order from InDesign document as a text file in utf-8 using AppleScript?

applescript tell application "Adobe InDesign CS6" set outputText to "" set savePath to choose file name with prompt "ファイルの保存場所を選んでください" default name "extracted_text.txt" -- 保存場所をダイアログで選択

repeat with currentPageIndex from 1 to count pages of active document
	set currentPage to page currentPageIndex of active document
	set textFramesOnPage to every text frame of currentPage
	repeat with currentTextFrame in textFramesOnPage
		set frameText to contents of currentTextFrame
		set outputText to outputText & frameText & return
	end repeat
end repeat

set outputFile to open for access savePath with write permission
set eof of outputFile to 0
write outputText to outputFile as "utf-8"
close access outputFile

end tell

V H

John V.

How can I use AppleScript in Adobe InDesign CS6 to extract all text from a document sequentially (page by page, top-to-bottom order) and output it as a UTF-8 encoded text file, prompting the user for the save location?

The following AppleScript can be used to extract all text from the active document, iterating through pages and text frames, and saving the output as a UTF-8 encoded file after prompting for the save location: applescript tell application "Adobe InDesign CS6" set outputText to "" set savePath to choose file name with prompt "ファイルの保存場所を選んでください" default name "extracted_text.txt" -- 保存場所をダイアログで選択

repeat with currentPageIndex from 1 to count pages of active document
	set currentPage to page currentPageIndex of active document
	set textFramesOnPage to every text frame of currentPage
	repeat with currentTextFrame in textFramesOnPage
		set frameText to contents of currentTextFrame
		set outputText to outputText & frameText & return
	end repeat
end repeat

set outputFile to open for access savePath with write permission
set eof of outputFile to 0
write outputText to outputFile as "utf-8"
close access outputFile

end tell

Preparing document for printing…
0%