Saving an Untitled Document

Note: This a modified version of the script on page 339 (Example 5) of the Adobe InDesign 2.0 Scripting Guide.

This script will only run if you have an Adobe InDesign document open as an unsaved document.

Remarks are shown in red .

Text to adapt to your own situation are shown in blue.

Rem Using "Save As"
Dim myInDesign As InDesign.Application
Dim myPub As InDesign.Document
Dim myPubName As String
Dim myPath As String
Set myInDesign = CreateObject("InDesign.Application")
Set myPub = myInDesign.ActiveDocument
myPubName = myPub.Name
Rem Process the publication name to remove the extension.
myPubName = Left$(myPubName, Len(myPubName) - 10)
Rem Remember--untitled documents have no path
Rem myPath = myPub.Path
myPath = "C:\My Documents\"
Rem Add "_New" to the end of the name.
myPubName = myPath & "\" & myPubName & "John2_New"
myPub.SaveAs (myPubName)
Rem To save as a template, use:
Rem myPub.SaveAs myPubName, True
arrow1.gif (846 bytes)InDesign Scripting Menu