AppleScript
--Hello World
tell application "Adobe InDesign CS2"
--Create a new document and assign its
--identity to the variable "myDocument"
set myDocument to make document
tell myDocument
--Create a new text frame on the first page.
tell page 1
set myTextFrame to make text frame
--Change the size of the text frame.
set geometric bounds of myTextFrame to {"0p0", "0p0", "18p0", "18p0"}
--Enter text in the text frame.
set contents of myTextFrame to "Hello World!"
end tell
end tell
end tell
Rem Hello World
Set myInDesign = CreateObject("InDesign.Application.CS2")
Rem Create a new document.
Set myDocument = myInDesign.Documents.Add
Rem Get a reference to the first page.
Set myPage = myDocument.Pages.Item(1)
Rem Create a text frame.
Set myTextFrame = myDocument.TextFrames.Add
Rem Specify the size and shape of the text frame.
myTextFrame.GeometricBounds = Array("0p0", "0p0", "18p0", "18p0")
Rem Enter text in the text frame.
myTextFrame.Contents = "Hello World!"
//Hello World!
var myDocument = app.documents.add();
with(myDocument){
var myPage = myDocument.pages.item(0);
with(myPage){
//Create a new text frame and assign it to the variable "myTextFrame"
var myTextFrame = textFrames.add();
//Specify the size and shape of the text frame.
myTextFrame.geometricBounds = [ "0p0", "0p0", "18p0", "18p0"];
//Enter text in the text frame.
myTextFrame.contents = "Hello World!"
}
}
Так вот, с помощью этого API можно не только "открыть/закрыть", но и очень даже ничего себе автоматизация получается. Многие рутинные вещи вешаются на горячие клавиши запуска своих скриптов и только в путь.