Closing a document. Adobe InDesign CS6
Reklam
Reklam
C HAPTER 3: Documents Basic Document Operations 22
--Save the active document as a template.
tell application "Adobe InDesign CS6" set myDocument to active document tell myDocument if saved is true then
--Convert the file name to a string.
set myFileName to full name set myFileName to my myReplace(myFileName, ".indd", ".indt") else
--If the document has not been saved, then give it a default file
--name/file path. You'll have to fill in the file path.
set myFileName to "yukino:myTestDocument.indt" end if save to myFileName with stationery end tell end tell on myReplace(myString, myFindString, myChangeString) set AppleScript's text item delimiters to myFindString set myTextList to every text item of (myString as text) set AppleScript's text item delimiters to myChangeString set myString to myTextList as string set AppleScript's text item delimiters to "" return myString end myReplace
Closing a document
The close command closes a document, as shown in the following script fragment (from the
CloseDocument tutorial script): tell application "Adobe InDesign CS6" close document 1
--document 1 always refers to the front-most document.
--Note that you could also use:
--close active document end tell
The close command can take up to two optional parameters, as shown in the following script fragment
(from the CloseWithParameters tutorial script): tell application "Adobe InDesign CS6"
--Use "saving yes" to save the document,
--or "saving no" to close the document without saving,
--or "saving ask" to display a prompt. If you use
--"saving yes",you'll need to provide a reference
--to a file to save to in the second parameter (saving in).
--If the file has never been saved (it's an untitled file),
--display a prompt.
if saved of active document is not equal to true then close active document saving ask
--Or, to save to a specific file name
--(you'll have to fill in the file path):
--set myFile to "yukino:myTestDocument.indd"
--close active document saving yes saving in myFile else
--If the file has already been saved to a file, save it.
close active document saving yes end if end tell
İndir
Reklam